0

I can no longer use public keys on one account I have on a remote system. It worked fine for a while, but it doesn't seem to now(I still have to input my password each time I login). It started one day when I had several terminals remotely logged into my account(scp and ssh) from the same computer (also I remember I changed the permissions on my home directory that day, and at one point really messed them up, I feel that may have something to do with it).

when I run ssh -v:

debug1: Connection established.
debug1: identity file /Users/bobak/.ssh/identity type -1
debug1: identity file /Users/bobak/.ssh/id_rsa type 1
debug1: identity file /Users/bobak/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the RSA host key.
debug1: Found key in /Users/bobak/.ssh/known_hosts:4
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/bobak/.ssh/identity
debug1: Offering public key: /Users/bobak/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /Users/bobak/.ssh/id_dsa
debug1: Next authentication method: password

any ideas as to what happened? There are other accounts on the computer which still work with RSA keys, but just not mine. I have tried to recreate the key, I have even gone as far as deleting my authorized keys file and remaking it, as well as trying from different computers.

5
  • Are the permissions on the files and upstream directories set correctly?
    – Xenoactive
    May 12, 2011 at 14:38
  • 2
    What are the permission of your .ssh directory and its content on the computer where you have to login by password ? Give the output of thess commands: ls -ld $HOME/.ssh and ls -Rl $HOME/.ssh
    – slubman
    May 12, 2011 at 14:43
  • home/.ssh/ is drwxr-xr-x home/.ssh/authorized_keys is -rwx------ May 13, 2011 at 1:07
  • I'm encountering a similar problem: on the same system, I use one RSA key to login to one account, but trying to set up public-private key auto-login with other accounts doesn't work. I'm on: ssh -v OpenSSH_5.2p1, OpenSSL 0.9.7l 28 Sep 2006 for my local laptop. I'm also using RSA like you are. May 16, 2011 at 23:52
  • @slubman for the account that works my file permissions are: drwx------ 2 mravery pg2054728 4.0K May 16 16:31 ./ and -rw------- 1 mravery pg2054728 1.2K Aug 7 2010 authorized_keys For the one that doesn't work: drwx------ 2 uclaan pg2054728 4.0K May 16 16:19 ./ and -rw------- 1 uclaan pg2054728 403 May 16 16:19 authorized_keys. May 17, 2011 at 0:01

1 Answer 1

0

I fixed my issue. The problem I was having was a permissions issue. My remote server is with Dreamhost so they may have configured the server set up so that public/private keys work like this. This is what I did, YMMV:

  1. Changed the permissions in the home folder of each of my accounts that this weren't working to 751. I'm assuming that your setup needs at least this if not stronger. This worked for me... but I also did these other steps which you can try.

  2. Changed the permissions of everything in .ssh to 600.

  3. Switched to using a new key with DSA instead of RSA. This was overkill but I encrypted the private key so now it asks for a password before I can use the private key. This is just a security measure. Mac OS X lets me save the password so that this happens transparently (ie. I don't have to type in my password per se).

1
  • DSA fixed it, but I still don't know what the problem was/is with RSA. Really odd, thanks for the patch though. Jun 1, 2011 at 20:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .