I would to know how I can deactivate the login password on my Raspberry Pi? I need to login automatically after entering the following command on terminal:
ssh pi@<IP_address>
i.e., it should not ask for password to login.
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.
Sign up to join this communityIt is NOT recommended to disable the SSH password if your device is going to publicly available - for example connected to the internet with SSH port forwarder.
To disable SSH login authentication you need to edit some files:
/etc/ssh/sshd_config
PasswordAuthentication yes
- ChallengeResponseAuthentication yes
- UsePAM yes
no
and have no #
in front.Restart SSHD or the Pi
If you get a message
Permission denied (publickey)
then set these in sshd_config to no
,
RSAAuthentication yes
PubkeyAuthentication yes
Restart SSHD or the Pi
TIPS
In sshd_config you can add. So it will only ask root for password,
Match User !root
PasswordAuthentication no
And then you add a new user with limited permissions.Always log in as that user and when you need to do something as root you can just use sudo "command"
- enter the root password and it will do it and come back to your low privilege user.
To elevate into a root console from low privilege just type sudo
enter your password. Once you are done type exit
and you will drop back to the low privilege user.
Did I already say that removing root user password and ssh key login is a very bad idea on a device that will be publicly available. Never do this on a public device!
PasswordAuthentication no
to disable password login? Is it really required to set also ChallengeResponseAuthentication no
and UsePAM no
?
Feb 4, 2017 at 8:03
Instead of not using passwords what you need is SSH keys: SSH with authentication key instead of password.
After configuring key authentication you can then remove the password from the local (client) key and ssh pi@rasp
will just work. But only from a machine that has the key.