I would like to disable passwords in sshd and use just keys.

root@igla:~# cat /etc/debian_version 
root@igla:~# uname -a
Linux igla.gotdns.ch 4.1.19+ #858 Tue Mar 15 15:52:03 GMT 2016 armv6l GNU/Linux

How do I do it with my Raspberry Pi?


After having setup SSH keys for authentication as mentioned in the first answer, you can disable password authentication (i.e. so that only logins with SSH keys work), by adding the line

PasswordAuthentication no

to /etc/ssh/sshd_config.

  • Can you elaborate on (Change to no to disable tunnelled clear text passwords)? – alexus May 7 '16 at 2:33

If you are using a Linux (or OSX) computer to ssh into your Pi. You could use this to add your key to the authorized_host file on you Pi. This requires that you already have generated your own ssh-keys on the client. Otherwhise, run:


To add your client to Authorized host on your server, run:

ssh-copy-id [user]@pi


ssh-copy-id root@

Disable password authentication by editing this line in /etc/ssh/sshd_config

PasswordAuthentication no

You could use ssh keys. http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/ I don't think you can remove authentication.

  • 1
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Also note that the OP was not asking to remove authenticiation but seems to be fine with keys. – Ghanima May 7 '16 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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