Setting Up Apache Server on a Raspberry Pi 3

Using SSH and SFTP to Remotely Manage the Raspberry Pi

Your browser needs to be JavaScript capable to view this video

Try reloading this page, or reviewing your browser settings

Teaches how to enable SSH on the Raspberry Pi so that it can be accessed using an SSH cleint called PUTTY on a personal computer. With SSH enabled, the server can now be used headless, meaning peripherals such as a monitor or keyboard can be disconnected from it.

Keywords

  • SSH
  • PUTTY
  • WinSCP
  • Secure Shell
  • SFTP
  • File Transfer Protocol
  • Raspberry Pi SSH
  • Headless server
  • server
  • administration

About this video

Author(s)
Braxton VanGundy
First online
19 March 2020
DOI
https://doi.org/10.1007/978-1-4842-5848-4_2
Online ISBN
978-1-4842-5848-4
Publisher
Apress
Copyright information
© Braxton VanGundy 2020

Video Transcript

SSH stands for Secure Shell Protocol and will allow us to manage the Pi remotely via a SSH command line client called PuTTY on our Windows machine. SFTP stands for SSH File Transfer Protocol. This protocol will allow us to transfer files between our personal computer and the Raspberry Pi over the network.

Before we can use either of these protocols, SSH must be enabled on the Pi. Launch the Pi software configuration tool using the command sudo raspi-config. In the configuration tool, use the arrow keys and Enter key on your keyboard to select the following options. Select interfacing options, SSH, yes, OK. Then when you’re back at the configuration tool menu, select Finish.

Since our server will eventually be exposed to the internet, it’s a good idea to change the default password. Change the default password using the password command. That’s passwd. First, enter the current password, which is raspberry, then enter a new password of your choice. Confirm your new password by entering it again. Now, reboot the Raspberry Pi by entering the sudo reboot command on the command line.

In order to access and transfer files to the Pi over SSH, SSH and FTP clients must be installed on our personal machine. First, download PuTTY, which will be used to manage the Pi through our command line interface. Go to putty.org and click the link to the download page. Choose the MSI installer for your version of Windows. I’m using a 64-bit machine, so I will download the 64-bit version. If you’re not sure what version you should download, the 32-bit version is a safe bet, as it’ll run on both 64-bit and 32-bit machines.

Next, download WinSCP. WinSCP will be used to transfer files to the Pi over SSH. Go to winscp.net in your browser and click the Download button. Run each of the installers, leaving any optional settings as their defaults.

Before we can access the Pi through SSH, we need to get the Pi’s IP address. You can think of an IP address as a unique ID for a specific device on your home’s network. Following a reboot, your Raspberry Pi should be back at the login screen. A few lines above the login prompt, there is a line that begins with “my IP address is” followed by your Pi’s IP address. Make note of this IP address.

Open PuTTY on your personal computer. Under Window in the Appearance menu, change the font size to 16. Now this isn’t necessary, but in my opinion, the default font size of 10 is too small to see. Now, click on Session and give your session a name. Under hostname, type in the IP address you obtained from your Raspberry Pi earlier. Save your session so you don’t have to type all this in next time you open PuTTY up. After you saved your session, click Open. A security warning will pop up prompting you to update PuTTY’s cache. Make sure you click Yes at this prompt. Now, enter your username and password.

Following a successful login, you will have full access to your Raspberry Pi through PuTTY. As of now, the server can run completely headless. You may now disconnect your monitor and keyboard if you wish, as everything from here on out will be done through PuTTY and WinSCP.