When you set up a Raspberry Pi, assuming you’re using Raspberry Pi OS, your system will have a default username of “pi” and password of “raspberry.” If you enable SSH for remote access, which is necessary if you’re doing a headless Raspberry Pi install, the system gives you a nagging warning message if you haven’t changed that password. You get a dialog box on the desktop that you have to click to dismiss and a small text notice in the terminal upon login.
Obviously, changing your password is good security hygiene on any computer, but if you have a lot of different Pis with different cards in your house and you’re not allowing SSH access from outside your local network, maybe you’d prefer the convenience of sticking with the default password so you won’t forget what to enter as you move from card to card and Pi to Pi.
Fortunately, there’s an easy way to disable the SSH password warning dialog box that appears in Raspberry Pi’s GUI and the more-subtle warning in the terminal. Here’s how.
Disable the SSH Password Warning in Raspberry Pi GUI
To get rid of the dialog box and the need to click “OK” every time you boot up or log in via VNC, just delete the file sshpwd.sh from the /etc/xdg/lxsession/LXDE-pi directory.
sudo rm /etc/xdg/lxsession/LXDE-pi/sshpwd.sh
Alternatively you can rename the file, just in case you want to bring it back some day. Or, if for some reason, you want to have fun by changing the error message, you can edit the file and change what the dialog box says.
Disable the SSH Password Warning in Terminal
The Raspberry Pi SSH password warning you get when you log into terminal is far less obtrusive. You don’t have to click anything to make it go away. However, if you want to get rid of it just delete the file sshpwd.sh from the /etc/profile.d folder.
sudo rm /etc/profile.d/sshpwd.sh
And that’s all you need to do. However, if you don’t find it too annoying, it might be just as easy to change your password.