p******g 发帖数: 347 | 1 This is really driving me crazy.
I am trying rsa public key to login to difference users in a remote RHEL6
box.
I created the rsa key in my local ubuntu box. I use ssh-copy-id to copy the
pub key to different users on the remove servers.
The pub key works for user1, but not for user2. On REHL6 box I copied the /home/user1/.
ssh/authorized_keys to /home/user2/.ssh/authorized_keys, then my local pc's
rsa key works for user2@RHEL6.
But the two authorized_keys are identical.
Here's it:
-bash-4.1$ ls -l
total 8
-rw-------. 1 svn svn 793 Feb 17 00:22 authorized_keys
-rw-------. 1 svn svn 793 Feb 16 22:11 authorized_keys.not
-bash-4.1$ diff authorized_keys authorized_keys.not
WHY!? any suggestions.
And once I make the copy, I can ssh-copy-id from other users on other boxes
to append more pub keys in user2 (svn)'s authorized_keys, no more problems.
And I copied the working authorized keys to /root/.ssh/, hoping it will work
for root@REHL6, but it doesn't. I still have to use the root password to
login... Tried to turn on ssh -vvv and sshd debug log, but it just shows the
key was not accepted by the REHL6 server. No further useful info. |
m******n 发帖数: 1691 | 2 because you copy authorized_keys to authorized_keys.not
so, they are identical. That's easy.
the
/home/user1/.
s
【在 p******g 的大作中提到】 : This is really driving me crazy. : I am trying rsa public key to login to difference users in a remote RHEL6 : box. : I created the rsa key in my local ubuntu box. I use ssh-copy-id to copy the : pub key to different users on the remove servers. : The pub key works for user1, but not for user2. On REHL6 box I copied the /home/user1/. : ssh/authorized_keys to /home/user2/.ssh/authorized_keys, then my local pc's : rsa key works for user2@RHEL6. : But the two authorized_keys are identical. : Here's it:
|
r****n 发帖数: 1088 | 3 check the owner group and user of authroized_keys?
the
/home/user1/.
s
【在 p******g 的大作中提到】 : This is really driving me crazy. : I am trying rsa public key to login to difference users in a remote RHEL6 : box. : I created the rsa key in my local ubuntu box. I use ssh-copy-id to copy the : pub key to different users on the remove servers. : The pub key works for user1, but not for user2. On REHL6 box I copied the /home/user1/. : ssh/authorized_keys to /home/user2/.ssh/authorized_keys, then my local pc's : rsa key works for user2@RHEL6. : But the two authorized_keys are identical. : Here's it:
|
p******g 发帖数: 347 | 4 no. i moved the original user2's authorized_keys to authorized_keys.not
before i copied the one from user1 over.
if i copy authorized_keys.not authorized_keys for user2, public key login
will fail again even though the two files are identical and have the same
ownership and access mode...
this is really weird... |
v*****r 发帖数: 1119 | 5 redken is right. This is caused by file/dir permission setting.
Same reason for your root access, run this in root home to fix the issue:
chmod go-w ~ ~/.ssh ~/.ssh/authorized_keys
【在 p******g 的大作中提到】 : no. i moved the original user2's authorized_keys to authorized_keys.not : before i copied the one from user1 over. : if i copy authorized_keys.not authorized_keys for user2, public key login : will fail again even though the two files are identical and have the same : ownership and access mode... : this is really weird...
|
p******g 发帖数: 347 | 6 I've done this already. it's not working.
As you can see, the two authorized_keys are identical, has the same owner:
group and same mode, and they are in the same path. one works and the other
one doesn't...
【在 v*****r 的大作中提到】 : redken is right. This is caused by file/dir permission setting. : Same reason for your root access, run this in root home to fix the issue: : chmod go-w ~ ~/.ssh ~/.ssh/authorized_keys
|
E*V 发帖数: 17544 | 7 ssh -vv
other
【在 p******g 的大作中提到】 : I've done this already. it's not working. : As you can see, the two authorized_keys are identical, has the same owner: : group and same mode, and they are in the same path. one works and the other : one doesn't...
|
p******g 发帖数: 347 | 8 i've done ssh -vvv, i turned on the ssd config debug as well. can't tell
what's the difference... will post the logs later.
【在 E*V 的大作中提到】 : ssh -vv : : other
|