komodosp
komodosp

Reputation: 3658

Can't generate a working ssh public / private key pair for new user

I'm trying to add a new user to my Ubuntu system and give them SSH access, using public/private key to log in. But I can't seem to get it to work.

Used putty gen to generate a public / private key pair. Then copied the public key into their homedir/.ssh/authorized_keys. But when I load the private key into Pageant in my windows session and try to use putty to get in, I am getting "Disconnected: No supported authentication methods available".

The funny thing is, If i put the same public key in the existing user's ./.ssh/authorized_keys file, I can log on using that user. This was set up by someone before me who I can't contact now though, so I don't know what the difference is.

If I check the etc/ssh/sshd_config file, the AuthorizedKeysFile line is commented out. #AuthorizedKeysFile %h/.ssh/authorized_keys

BUt even if I put it back in and restart ssh service it still doesn't work (though I didn't think would solve it because why would the current user work)

Is there anything I can do?

Upvotes: 2

Views: 510

Answers (1)

Daniel Roethlisberger
Daniel Roethlisberger

Reputation: 7065

Read the sshd daemon's error messages in your system log (auth.log or security.log or some such).

My guess would be that the directory and/or file permissions on .ssh or .ssh/authorized_keys are too permissive (insecure) in the new user's home. This should fix it if this is the problem:

chmod 700 .ssh
chmod 644 .ssh/authorized_keys

Upvotes: 1

Related Questions