SSH
Enabling SSH (Secure Shell) allows remote connection to the Raspberry Pi. This provides a means for adding roms, changing configuration, updates, and other convenient procedures by using SSH and SFTP clients to connect to the Raspberry Pi. For this instruction and for the sake of simplicity, this guide assumes that both the Raspberry Pi and the computer you are using to remotely connect to it are on the same local network.
Note
Your Raspberry Pi needs to be connected to the same network/router (either via Ethernet/Cable or Wi-Fi) as the computer you are accessing it from.
Here are a few (free) popular clients to try. These need to be installed on the PC, Mac, or other computer you are using to connect to the Raspberry Pi:
- Windows:
- Windows 10 SSH Client - Available since Windows 1809 build.
- Putty - Very simplistic access to allow for console commands, but does not feature the ease of drag & drop for ROMs and other files.
- WinSCP - An SFTP client that features an easy way to drag & drop files. Console commands are also possible (and even integrates with Putty) but is a secondary user interface found in the
Commands
>Open Terminal
orCommands
>Open in Putty
menus. - MobaXterm - A feature-rich console commands and drag & drop client that includes most ways to remotely connect to another computer, including SSH, SFTP, and even VNC (allows viewing the screen of another computer).
- Mac:
Enable SSH
Note: Starting with RetroPie 4.2, in order to keep the default image secure, SSH is disabled by default. You will not be able to remotely connect to it until it has been enabled using ONE
of the instructions below.
(Option 1) From the SD Card
If your computer has an SD-card reader or a special USB stick that allows inserting an SD card, plug it into your computer, open the new drive to access your SD-card's boot
partition, and create an empty file called ssh
or ssh.txt
in the root directory. Ignore any warnings about the drive needing to be repaired (on Windows).
(Option 2) From the RetroPie menu
- Select
raspi-config
from the RetroPie menu after booting up. - Select
Interface Options
- Select
SSH
- Choose
Yes
- Select
Ok
- Choose
Finish
(Option 3) When using BerryBoot
When using RetroPie with BerryBoot you cannot use raspi-config
. There is a workaround to enable SSH:
- Boot to RetroPie (via BerryBoot)
- Enter shell by pressing Ctrl + F4
cd /boot
sudo touch ssh
sudo reboot now
- Done!
Connecting
Four credentials are needed to remotely connect to your Raspberry Pi: IP address, port, username, and password. These will be the same with any client (WinSCP, Putty, MobaXterm, etc).
Default Login
In your chosen client, enter the following:
- IP address: See below note
- Port:
22
- Username:
pi
- Password:
raspberry
Note: The IP address is unique to your local network, and can be found by selecting the Show IP
option in the RetroPie
menu after booting up your Raspberry Pi.
Example using Putty:
Example using WinSCP:
Root Access
Warning
Root access is meant for advanced users only, and only for functions not possible with the pi
user. Do not use the root
account when transferring ROMs, playing games or other tasks available to the default pi
user.
For more advanced users, root access can more easily allow for editing protected files such as the config.txt
when overclocking. This allows users to remotely make changes, reboot, and instantly view performance changes.
See here if you wish to log in as root.
Common Terminal Commands:
Reboot:
sudo reboot
sudo shutdown -h now
cd /path/to/directory
ls
sudo /home/pi/RetroPie-Setup/retropie_setup.sh
sudo nano /path/to/file.txt
sudo chown pi:pi filetobechanged
sudo chown -R pi:pi /folder/to/be/changed
Make shell script executable:
sudo chmod +x yourshellscript.sh
Extra Configurations
If you find that you are getting weird characters on the dialog gui for the RetroPie Setup script you can change the font encoding to make it look pretty again.