Network Protocols
Contents
Overview[edit]
This page covers network protocols that you may find useful.
SSH[edit]
SSH enables you to remotely access a machine through a network. Basic ssh usage is as follows:
$ ssh username@ip
FTP[edit]
Occasionally you may want to use a GUI to browse and transfer files. The File Transfer Protocol (FTP) is a standard network protocol used for the transfer of computer files between a client and server on a computer network. FTP is built on a client-server model architecture using separate control and data connections between the client and the server.
FileZilla is a free to use FTP program available for Windows and Linux. Download and install it.
When you launch FileZilla, a GUI with a few options across the top will be shown. In “Host”, enter in “sftp://192.168.137.15”. In “Username” and “Password” enter in the username and password you use to SSH in to your machine. Click “Quickconnect”
When connecting for the first time, you can choose to save the password or set a master password. Neither of these are necessary. You will be asked to add the server’s host key. Click “always trust this host, add this key to the cache” and select “OK”.
You will now be able to browse the files on the Raspberry Pi, and drag and drop from the Pi to your computer, or from the computer to your Pi.
VNC[edit]
In computing, Virtual Network Computing (VNC) is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer.
There are various options for VNC servers. For example, Raspbian comes installed with Real VNC but it needs to be enabled. Other options, such as tightVNC and ultraVNC also exist and can also be used.
- You will need to ensure the device you want to VNC in to has a VNC server. For instructions on doing this on the Raspberry Pi, read RaspberryPi:Networking#VNC
- Download a viewer
VNC Viewer is available at this URL:
https://www.realvnc.com/en/connect/download/viewer/
Download your choice of app (For example the standalone installer or the Chrome App) - Set up the connection
- Open up VNC viewer
- Enter the IP of the machine you'd like to connect to
- Click connect
- You will need log in
SMB (Samba)[edit]
Samba is a free software re-implementation of the SMB networking protocol, and was originally developed by Andrew Tridgell. The name Samba comes from SMB (Server Message Block), the name of the standard protocol used by the Microsoft Windows network file system.
Enabling the Samba service[edit]
On Windows 10, you need to enable the Samba service. You can do so by following the instructions in this link. The alternative is to use a program such as jfftp.
In jfftp you need to set up the following settings to access : Name: hive-smb (as an example) Host: hive.ee.uct.ac.za Protocol: SMB(445) Port: 445 Username: guest Leave Identity Key blank Set an appropriate Init Local Folder (e.g. c:\) Init Remote Folder: /public
Connecting to a Samba service[edit]
- Linux
- Mac
- Windows
- Enter in the Samba directory/url in a File Explorer window.
SCP[edit]
SCP or “Secure Copy” is a protocol that allows you to transfer files. To read all the details relating to scp, run man scp
on your linux machine. The basic format of the command is as follows:
$ scp <local_file> <username>@<destination_ip>:<source_directory_location>
As an example, this is what connecting to a Raspberry Pi at 192.186.137.15 would look like:
Sending a single file from your computer to the Pi
$ scp <file_name> <username>@192.168.1.15:
Sending a folder from your computer to the Pi
$ scp -r <folder_name> <username>@192.168.1.15:
Sending a single file from your computer to a specific folder on the Pi:
$ scp <file_name> <username>@192.168.1.15:<destination_directory>
Using SCP on Windows[edit]
On Windows, SCP may not be enabled. You can get around it by using the pscp
command, included in the full PuTTY suite. It operates in the exact same way, but instead of running scp
, you need to run pscp
.