Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've recently set up a server, and I've set up RSA authentication on said server. My question is, how do I set up RSA authentication for different users? As of right now, the only user that has RSA auth is root, and I'd rather not keep it that way. I've tried adding my RSA key to /home/username/.ssh/authorized_keys and restarting SSHD, but I still can't login with that username. Anyone have any ideas?

Damnit, Jim, I'm a developer not a server administrator.

share|improve this question

I'm assuming you setup root by putting the key in /root/.ssh/authorized_keys too? It is not uncommon for there to be permissions issues that cause the authorized_keys to be ignored for users.

Verify that ~/.ssh/ is 700 and verify that ~/.ssh/authorized_keys is owned by the user and 600:

$ cd ~/.ssh/; ls -ld
drwx------ 2 somedude somegroup 4096 Aug 21 21:09 .
$ ls -l authorized_keys
total 52
-rw-------  1 somedude somegroup  4324 Oct 14  2010 authorized_keys

If that all looks good and it still doesn't work change the LogLevel in your /etc/ssh/sshd_config to DEBUG3 and restart sshd:

# grep LogLev /etc/ssh/sshd_config
LogLevel DEBUG3
# /etc/init.d/sshd restart

Now try and ssh to your box. You should get syslog output that will hopefully point you at the issue. If you are having problems seeing the debug output in any logs, try just stopping sshd and running it on the command line:

# /etc/init.d/sshd stop; sshd -d

(be careful here, the sshd will die after the first connect in debug so restart it quickly otherwise ssh will be down on your box...)

If it isn't clear what the issue is still post the debug output as well as the output of ssh -v username@server into the question.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.