1

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

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

How do I do it with my Raspberry Pi?

3 Answers 3

2

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:

ssh-keygen

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

ssh-copy-id [user]@pi

example:

ssh-copy-id [email protected]

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

PasswordAuthentication no
1

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.

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

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
  • 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, 2016 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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