How to SSH in Raspberry Pi
A cryptographic network protocol - “Secure Shell” (SSH). Using SSH anyone can access the command line of a Raspberry Pi from anywhere in the world. The only thing that is required is a Raspberry Pi with a network connection.
In this blog, you’ll learn how to SSH in Raspberry Pi. Before moving to the steps of how to enable it to make sure that your Pi is connected to a network via Ethernet/WiFi.
By default, SSH is disabled in Raspberry Pi in a freshly installed OS. You need to enable it manually for the first time to access the Pi remotely. Follow the steps below for the same.
Micro bit Starter kit (The Programmable Blocks Kit for micro:bit)
Step 1: Enable SSH
There are various methods to enable/disable ssh on your Raspberry Pi. Below are the graphical and CLI based method to enable the ssh.Enabling SSH using GUI
- You can enable SSH using Raspberry Pi GUI. Click on the Raspberry Icon and select “Preferences” from the drop-down menu.
- Select Raspberry Pi configuration.
- Go to the interface.
- Enable the SSH.
Enabling SSH using Terminal
- Go to the terminal. Enter into the Raspberry configuration using “sudo raspi-config”
- Go to “Interfacing Options” using up/down arrow, hit enter to select the option.
- Select and enable SSH. You’ll find lots of options like VNC, I2C, and SPI etc.
- Select SSH, select yes for “Would you like the SSH server to be enabled” option.
Step 2: IP address
To SSH you need an IP address of the Pi to which you are going to connect. If you know the IP address then it’s good but what if you don’t know the IP. In that case, you can use “ifconfig” or “hostname -I” commands to find the IP address:
Go to the Terminal and write “ifconfig”, you’ll get your IP address.
Step 3: SSH in Raspberry Pi
Once you are done with the above steps, now you can SSH by following the steps below.
Open the terminal:
- Write command “ssh” with the username and the IP address
Format: ssh username@ipaddress
Example: ssh email@example.com
For the first time, it will ask for permission, type “yes”.
- Enter the password of your Pi when prompted. While you type the password, nothing will appear on terminal, when you have typed the password hit “enter”.
- If the password is correct, you will get the access to the terminal of your Pi.
You might be wondering why we would access the terminal of Raspberry Pi when we can get access to its desktop using other simple methods. SSH provides a very secure way to access your remote device. The data is encrypted using RSA keypairs.
SSH is used not only in Raspberry Pi but other machines, servers, etc. SSH also allows for the tunneling of other protocols such as FTP, known as SFTP.
Hope this article was helpful to you.
Check out or new Product: BreadPi - Multipurpose HAT for Raspberry Pi