PuTTY is a free, open-source Linux terminal emulator, serial console and network file transfer application. It is used to connect to a remote device with one of its many connection types.
Apart from various other functions, PuTTY can be used to establish a command-line interface (CLI) between a personal computer and a remote Raspberry Pi. This post points out how to download, install and configure PuTTY, and how to connect to Raspbian, OpenELEC, XBMC and RetroPie. PuTTY’s SSH connectivity will be used.
PuTTY can use SSH (secure shell or secure socket shell) to log in to Linux operating systems using their usernames and passwords. Raspbian, OpenELEC and RetroPi are among the systems that can be connected to.
Why use PuTTY to connect to a Raspberry Pi
Raspberry Pis are popular to use as small, standalone devices on a network. By using PuTTY, the need for these devices to have a keyboard, mouse and screen is reduced to only their setup phases. After an IP address has been obtained, PuTTY can be used from a remote computer to have full access via a terminal.
PuTTY used together with WinSCP will extend access to a user-friendly file copy interface. WinSCP uses SCP and functions as a visual representation of the directory and file structures.
Requirements & assumptions for using PuTTY
- Both the Raspberry Pi and the remote computer needs to be connected on the same local network.
- The Raspberry Pi needs to have SSH enabled. Some Raspbian distributions has SSH enabled by default, but can be configured using the Raspi-config tool.
- The IP address of the Raspberry Pi needs to be known. A quick way to get the IP address of the Raspberry Pi is by using the following terminal command:
hostname -I
- (Optional) Although a static IP address for the Raspberry Pi is not required, it is recommended. A static IP will standardise the address used to access the Raspberry Pi.
Raspberry Pi first time setup
Things you’ll need for your first Raspberry Pi build
Using PuTTY to connect to a Raspberry Pi
Setting a static IP on the Raspberry Pi and Raspbian
Setting a static IP on the Raspberry Pi using Wi-Fi and Raspbian
3 ways to connect a Raspberry Pi 3 to a network using Wi-Fi
Downloading, installing & configuring PuTTY
Putty is available for download and installation on Windows and UNIX-based operating systems. The PuTTY installation file can be downloaded from here. For Microsoft Windows users, simply run the downloaded file by double-clicking on it and follow the on-screen instructions.
The first time PuTTY is opened there will be no Saved Sessions. A saved session is basically a name given to a group of settings (including the IP address, connection type and close window on exit method for the remote Raspberry Pi).
Under Host Name, enter the IP address of the Raspberry Pi, leave the port to 22, make sure SSH is selected and give it a name under Saved Sessions, then click the Save button. Multiple Saved Sessions to different Raspberry Pis can be created.
In this case, Kim, Mockingbird, Panda, etc. are all saved sessions to different Raspberry Pis.
By double-clicking on the Saved Session name, the Raspberry Pi’s terminal will open. During the first connection, PuTTY will obtain the host key from the Raspberry Pi, which will probably cause security-alert to popup.
Click Yes to continue with the connection.
For Raspbian, the default username and password is pi
and raspberry
.
The settings can be changed by selecting the applicable Saved Session and pressing the Load button. After changing the settings it needs to be saved again.
Although PuTTY is mainly a Telnet and SSH client, other connection types include Raw, Rlogin and serial can also be used to connect to other devices.
PuTTY alternatives
PuTTY makes is easy to establish a non-intimidating, CLI between a personal computer and a Raspberry Pi. As mentioned earlier, its main connection method is SSH. An alternative for using PuTTY is using the Windows Command Prompt (searchable from the Windows search icon).
To use the Windows Command Prompt to connect to a Raspberry Pi, the SSH command can be used as follows:
ssh <USERNAME>@<IP ADDRESS>
where <USERNAME> is the username and <IP ADDRESS> is the IP address of the remote Raspberry Pi, e.g.:
ssh [email protected]
After the command was entered, the SSH command will ask for the password of the Raspberry Pi. The default password for Raspbian is raspberry
.
Using PuTTY to connect to OpenELEC & XBMC (Kodi)
Kodi might not have SSH enabled. SSH can be enabled from the Services section by going to Settings -> OpenELEC -> Settings (do not change the username and password settings for now). A reboot might be required.
The default username and password for OpenELEC is root
and openelec
and root
without a password for XBMC.
Using PuTTY to connect to RetroPie
To use PuTTY to connect to RetroPie, SSH needs to be enabled from the RetroPie Configuration screen. This is done by choosing RASPI-CONFIG-> 5 Interfacing Options -> P2 SSH.
The default username and password for RetroPie is pi
and raspberry
.