I've set up an linux server (32 bit), and would like to be able to ssh in as root based on RSA or DSA key trust. I've appended both public keys to ~/.ssh/authorized_keys and restarted the service; I am still prompted for a password. How do I enable key-based trust for ssh here?
Asked
Active
Viewed 484 times
1
-
~/.ssh/* are all mode 600. – Christos Hayward Feb 24 '12 at 15:15
-
Restarting sshd is not necessary when adding new keys to a server. – EEAA Feb 24 '12 at 15:26
-
1Beginner questions regarding Linux should be aimed at [unix.se] unless they have a strong System Administrator angle. – Chris S Feb 24 '12 at 15:40
-
The checklist provided in @ErikA's answer I had all done. This isn't "I'm a beginner; what do I need to do to get this working;" it's "Why are the standard steps not working?" – Christos Hayward Feb 24 '12 at 18:59
-
Add a `-v` to your ssh connect command and post the output. In particular we need to see the bits where key negotiation is happening. – Zoredache Feb 25 '12 at 01:07
-
Can you login using a non-root user? If so, you may have `PermitRootLogin no` in your `sshd_config` file. – Khaled Feb 25 '12 at 08:06
2 Answers
0
~/.ssh
should be owned by the user and mode 700.~/.ssh/*
should be owned by the user and mode 600.- Each public key should occupy one and only one line of the
authorized_keys
file. RSAAuthentication yes
should be in yoursshd_config
.

EEAA
- 109,363
- 18
- 175
- 245
-
I had all of these in place before asking; is there anything else? – Christos Hayward Feb 24 '12 at 17:03
-
1Check what gets logged both by the client (`$ ssh -vvv user@host`) and by the server ( in `/var/log/auth.log`) when the user tries to connect with a key. – EEAA Feb 24 '12 at 19:01
0
Check to make sure following is true in the case of your SSHD server
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
Sometimes AuthorizedKeysFile switch is directed towards authorized_keys2 file
Then add your public keys under your
/your/home/.ssh/authorized_keys or /your/home/.ssh/authorized_keys2 depending on your configuration.
Yes and finally chmod authorized keys to 600.
****Please also check on "ErikA"'s answer

kaji
- 2,528
- 16
- 17