-   Linux - Software (
-   -   ssh authorized keys from one directory to another directory did not worked (

tkmsr 10-25-2010 08:14 AM

ssh authorized keys from one directory to another directory did not worked
I have an access to a machine on lan via ssh and I use key based authentication.I created one more account on the remote machine and copied


cp home/oldaccount/.ssh/authorized_keys home/newaccount/.ssh/authorized_keys
Now when I tried to login to the other account via ssh from my laptop it did not worked.Though the copy of keys from laptop .ssh/ to
remote machine new account .ssh/authorized keys did worked.

I was wondering I had added same keys to old account so why did simple copying the authorized keys from one account to another did not worked.
Because when I did cat > authorized_keys in new account I had created same file which was in old account.
Why is this happening or my observation is wrong.

prayag_pjs 10-25-2010 08:28 AM

Try ssh -v remote ip you may get any clue also see /var/log/secure

djsmiley2k 10-25-2010 08:51 AM


Originally Posted by
File and Directory Permissions
Here's an issue that frequently trips people up: by default, sshd has requirements for the permissions on the authorized_keys file, as well as its containing directory ~/.ssh, and the home directory. Specifically, none of these may be writable by any uid except the owner or root. That means the most permissive modes you can have here are:

$ chmod 755 ~
$ chmod 755 ~/.ssh
$ chmod 644 ~/.ssh/authorized_keys

The reason for caring about the directory permissions, is that it doesn't do much good to protect the authorized_keys file, if someone else can simply delete it and create a new one (by modifying the containing directories).

I think the permissions may of changed before/when you copied it :)

eSelix 10-25-2010 09:18 AM

And/Or owner and group of file. Change owner as newaccount, and check permissions.

tkmsr 10-25-2010 09:28 AM

Yes you all are right permissions were the problem.

All times are GMT -5. The time now is 12:11 AM.