I have an new Ubuntu (Hardy 8.04) server; it has two users, Alice and
Bob. Alice is listed in sudoers. I appended my public ssh key (my local machine's public key local/Users/nick/.ssh/id_rsa.pub) to authorized_keys in remote_server/home/Alice/.ssh/authorized_keys, changed the permissions on Alice/.ssh/ to 700 and Alice/.ssh/authorized_keys to 600, and both the file and folder are owned my Alice. Then added I Alice to sshd_config (AllowUsers Alice).
This works and I can login into Alice:
ssh -v
[email protected]
...
debug1: Offering public key: /Users/nick/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
Last login: Mon Mar 15 09:51:01 2010 from 123.456.789.00
I then copied the authorized_keys file remote_server/home/Alice/.ssh/authorized_keys to remote_server/home/Bob/.shh/authorized_keys and changed the permissions and ownership and added
Bob to AllowUsers in sshd_config (AllowUsers Alice Bob). Now when I try to login to
Bob it will not authenticate the same public key.
ssh -v
[email protected]
...
debug1: Offering public key: /Users/nick/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/nick/.ssh/identity
debug1: Trying private key: /Users/nick/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
Am I missing something fundamental about the way ssh works?