Configuring RetroPie Samba shares to require authentication ๐Ÿ”’

As a HUGE retro gaming fan ๐Ÿ•น๏ธ, I absolutely adore RetroPie which turns my Raspberry Pi 4 into an emulation powerhouse ๐Ÿ‘พ! Here’s some blurb from their official site that explains more:

RetroPie allows you to turn your Raspberry Pi, ODroid C1/C2, or PC into a retro-gaming machine. It builds upon Raspbian, EmulationStation, RetroArch and many other projects to enable you to play your favourite Arcade, home-console, and classic PC games with the minimum set-up. For power users it also provides a large variety of configuration tools to customise the system as you want.

RetroPie sits on top of a full OS, you can install it on an existing Raspbian, or start with the RetroPie image and add additional software later. It’s up to you.

One of the methods to copy data to RetroPie (for example ROMs and BIOS files) is to connect using SMB, RetroPie comes pre-configured with Samba which is a Linux re-implementation of SMB.

On Windows, it’s as simple as opening \\RETROPIE or \\IP Address of RetroPie to connect to RetroPie and copy files across.

One issue and slight concern I have is that in its default configuration, the shares created by RetroPie are available without authentication. I first realised this when I saw the following error on my Windows PC when trying to connect to my RetroPie:

“You can’t access this shared folder because your organization’s security policies block unauthenticated guest access”

My company block devices connecting to shares that don’t require authentication (which is good!). Therefore, to allow me to connect to the shares created by RetroPie using my Windows PC, I needed to re-configure Samba on the RetroPie to require authentication. I did this using the following steps:

  1. SSH’d into my RetroPie, using the command ssh pi@192.168.1.206 (the IP address of my RetroPie)
  2. Took a backup of the Samba configuration (incase it all went horribly wrong!) – sudo cp /etc/samba/smb.conf /etc/samba/smb.conf-retropie
  3. Edited the smb.conf using the Nano text editor – sudo nano /etc/samba/smb.conf

Made the following changes:

  • Changed map to guest from bad user to never
  • Changed guest ok from yes to no for each of the four shares created by RetroPie (roms, bios, configs and splashscreens)
  1. Saved the file by pressing CTRL + X, then selecting Y (to confirm changes) and pressing Enter to confirm the filename (which default to it’s current name)
  2. Ran sudo smbpasswd -a pi and to create a password for the pi user account, which I will be using to connect to the share
  1. Restarted Samba using the command: sudo service smbd restart

I then attempted to connect to the RetroPie using it’s IP address (192.168.1.206)

…and was presented with the following, where I selected Use a different account

I then entered the credentials for the pi account (using the password I assigned in step 5 above) and hit OK.

Success! I now have access to the RetroPie’s shares ๐Ÿ˜€.

Now for the fun of copying 50GB of data to the RetroPie over WiFi ๐Ÿคฆโ€โ™‚๏ธ.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s