SCP Requires Password After System Restarted Following Power Outage
I have two systems: a server running Ubuntu 11.4 and a client running Ubuntu 11.10. I set the system up to allow me to scp from the client to the server without a password using the steps outlined here.
Everything worked fine until there was a power outage and I needed to restart the systems. Now scp always asks for a password. I was wondering what could have changed. Should I go through the whole setup procedure again? Thanks, Peter. |
check both systems for the files you created (id_rsa and id_rsa.pub) in addition to known_hosts and authorized_keys. then verify their permissions on both sides. they should look something like the following:
Code:
drwx------ 11 user user 374 Mar 14 19:32 ./ |
Quote:
Can you log in with a password? If yes, then the key exchange is not working. If not, then the problems may be deeper. |
Quote:
Code:
-rw------- 1 root root 613 2012-08-25 17:29 authorized_keys Thanks, Peter |
Quote:
Code:
sudo scp Code:
scp Code:
./executable Code:
sudo ./executable Peter. |
Sounds like sudoers is directing it to run as a different user, that doesn't have an ssh auth-key.
Quote:
|
when you sudo you are running as some user other then the user you are log in as, mainly as root, this is wrong and bad.
also you should not have changed the permissions on ~/.ssh to root root that is wrong and bad. put them back to the owner of /home/user, who ever the user is. again read my post, if the permissions are WRONG, you will not be allowed to use passwordless authentication, ie: you will not be able to use ssh keys to authenticate due to permissions issues. when you ssh or scp to a remote location you should ALWAYS user the following basic format: Code:
ssh remote_user@remote_IP if you change any one of the above passwordless authentication WILL FAIL. 1. set your permissions back to the user and its group 2. verify that permissions and ownership are 100% correct 3. confirm that your sshd.conf is configured properly 4. follow basic syntax for both ssh and scp |
here follow this simple howto:
Quote:
|
Quote:
Thanks, Peter. |
Quote:
|
Quote:
|
It sounds to me like the ssh-agent program did not restart. The agent is the program, on the client machine, that's supposed to intercept the public-key request and figure out what public-key to offer. If it's not running, no key is offered.
But it also sounds like the remote system is configured to accept a password if you don't present the proper key. It shouldn't be permitted to do that. Either you have the key, or you should not be allowed in. Quote:
|
All times are GMT -5. The time now is 05:03 PM. |