Enabling password login for SSH on your Raspberry Pi is a straightforward process. Here's how you can do it:
1. Enable SSH
First, you need to enable SSH on your Raspberry Pi.
- Using the Raspberry Pi Configuration Tool:
- Navigate to the "Interfacing Options" menu.
- Select "SSH" and enable it.
- Click "OK" to save the changes.
- Using the command line:
- Connect to your Raspberry Pi via SSH using an existing connection or using a tool like PuTTY.
- Run the following command:
sudo systemctl enable ssh
- This command enables the SSH service to start automatically on boot.
2. Set a Password
If you haven't already set a password for the default user, pi
, you need to do that.
- Using the command line:
- Connect to your Raspberry Pi via SSH.
- Run the following command:
sudo passwd pi
- You will be prompted to enter a new password and confirm it.
3. Access via SSH
Now you can connect to your Raspberry Pi using SSH with the password you just set.
- Using a tool like PuTTY:
- Open PuTTY and enter the IP address of your Raspberry Pi in the "Host Name (or IP address)" field.
- Select SSH as the connection type.
- Click "Open" to connect.
- You will be prompted to enter the username (
pi
) and the password you set.
4. Security Considerations
While password login is convenient, it's generally considered less secure than using SSH keys. If you are concerned about security, consider setting up SSH keys for authentication instead.
5. Additional Tips
- If you're using a Raspberry Pi with a graphical interface (like Raspbian), you can also enable SSH from the "Raspberry Pi Configuration Tool" under the "Interfacing Options" menu.
- The
sudo
command allows you to run commands with root privileges. Use it cautiously.