Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am trying to use the scp command but I'm getting the following error:
permission denied
lost connection
I get this when I use scp to copy a file from a master node to a slave node.
This is probably more like your error, ya?
Permission denied (publickey).
lost connection
The simplest problem is that you don't have permissions to access the directories specified on at least one end of the copy operation, or you may just have a bad login.
You could try using sudo chown -R
*username* to make sure you have rights to the target directories on
both ends.
Check your directory specifications, make sure that you are using ~/Documents for instance instead of /Documents. Very different locations.
If you've got a bad login, I can't help you there, sorry. Try just ssh-ing into the target(s) make sure you can.
You could check out the manpage for more help
I think error in giving permission to folder which has the authorized_keys file
use chmod and set the permissions
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I currently have access to a supercomputer cluster.
The problem starts when I enter.
When I try to perform the following command line ssh -i user # extension, I get the following error
Warning: Identity file user # extension not accessible: No such file or directory.
I have tried testing the public root key and if it recognizes it, instead when I run in /home/user, I get the error.
I've been trying some permission changes with the chmod command and I can't get a solution.
ssh -i is to reference a private ssh key.
So if you have a key pair named user.rsa/user, that might work.
But in your case, "user" is not the name of the key, but simply the remote user you want to open a secure shell with on the remote server
ssh user#remoteServer
You don't need -i, if you have a default id_rsa/id_rsa.pub key pair in your local ~/.ssh
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I need to automate a file transfer using scp and I have created a new ssh key and sent the public key to the remote server where I'll be sending files to (# ~/.ssh).
The problem is that it won't allow me to scp the file anywhere except the home directory. If I transfer it to the home directory, it works fine, but not anywhere else.
Is there something that needs to be done here? Thanks!
If you can scp the file to your home directory, then your key is working. That is unlikely to be an issue.
The kinds of problems you might have would be:
You don't have permission to write to the destination directory
$ scp test.txt myserver:/root
scp /root/test.txt: Permission denied
In this case you need to get permission to write to the directory, or choose a different destination that you do have access to.
The destination directory doesn't exist
$ scp test.txt myserver:foo/bar/
scp foo/bar: No such file or directory
In this case, check that you're uploading to the correct path.
A destination like myserver:foo/bar/ (note: no / after the :) means a relative path to your home directory. So, it might be /home/seumasmac/foo/bar/ in this case.
A destination like myserver:/var/www/ (note: there is a / after the :) is an absolute path. It means the directory /var/www/ on the server.
The error that you get when you try to upload should tell you which of the above is the problem in this case.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I can't seem to log in to my droplet on digitalocean.
When I try ssh root#162.243.123.123 I get a Permission denied (publickey). I tried resetting the root password and logging in via the digitalocean droplet console, but it won't take the root login or password that was reset. Nor will it take the other username and password that I set up.
Everything was working fine yesterday, but when I started work today I ran into the Permission denied issue. So I'm not sure what changed to make this no longer work. I also checked my github keys to see if it hadn't been added, but my local machines key is there and correct. I've also tried adding the key to the droplet with ssh-copy-id admin#162.243.123.123, but got the same error.
Looking at the keys found when logging into the digitalocean website shows the correct key.
The issue was on the server-side authorized_keys, but not the ~/.ssh/authorized_keys. It was in a separate /home/user/.ssh/authorized_keys file, where I had to add the ssh-keys. Once I did this the issue went away. Not sure how it got removed from that file since I hadn't modified it.
This video helped.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Apologies if this has already been asked already, but I tried a quick search and couldn't find my problem.
Basically I am trying to SSH a file onto my friends server from my computer for him to read and modify himself. He has given me my own login and sufficent rights etc, but he is unable to see what I've uploaded to the server, nor can I see what he has added.
I am currently using:
scp hello.txt username#domain.com:/home/username/
which uploads correctly and I can see it.
Could someone please help me out and explain why he is unable to view what he's uploaded, and vice versa?
How can we set it up so we can see each others files and modify them (some sort of public folder?)?
The problem are most likely the access rights on the directory/file. A non-root user might not be able to see the contents of the home directory of another user. If you upload a file to your home directory, your friend can consequently not see the uploaded file and vice versa.
The solution is simple: you need a directory on which both of you have the appropriate permissions, as you already assumed. Try this:
# on the server
mkdir /var/your_share/
chmod o+rwx /var/your_share/
# on your host
scp hello.txt username#domain.com:/var/your_share/
# on the server
ls -l /var/your_share/hello.txt
The ls -l displays the permissions of the uploaded file.
-rw-r--r-- 1 username username 10 Oct 13 15:49 hello.txt
If it says something like this, your friend will not have permissions to change the file but only to read it. Use the following command to grant him write permissions for that file:
# on the server
chmod o+w /var/your_share/hello.txt
ls -l /var/your_share/hello.txt
The output should then be something like:
-rw-r--rw- 1 username username 10 Oct 13 15:49 hello.txt
Note: The permissions granted in these commands are not only for the account of your friend but for all accounts on the server. That means everybody can read and write to the file. If you want to change that, you have to setup a group and only grant rights to the group.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
ssh user#host works (in a script via Apple Terminal)
does anybody know an easier way than ssh-agent to combine the passphrase with the ssh command ?
regards
You can use:
sshpass -p password ssh user#host
However if you wanted the luxory of not typing in your password, I would HIGHLY suggest setting up public/private ssh keys:
http://www.ece.uci.edu/~chou/ssh-key.html
and http://www.linuxproblem.org/art_9.html
This is extremely secure, and very convient.
For scrub just take a look to the configuration files of your installation of open ssh, cause you'll find every single option you can include or deactivete while you connect to the server. There is an option of fusemount for example if you'd like to have your machine conneted to the one in which you're logging in ( i used it with my netbook when they were REAL netbook and not computers). Fusemount is an option when you want more abilities to be added to you computer or you need data from both sides (the one of the server and the one of the client) but security cannot be omitted in any case.