Skip to main content

Connecting to Your Server: SFTP, FTP, and SSH

This article will guide you through the process of connecting to your server using the three common protocols SFTP, FTP, and SSH.

The different protocols

  • SFTP: Use SFTP when you need a secure and encrypted way to transfer files, especially for sensitive data.
  • FTP: FTP is for file transfers and does not use encryption. It should only be used if no other option is available.
  • FTPS FTPS is FTP with added security through TLS/SSL encryption. It is suitable for secure file transfers.
  • SSH: To remotely connect to your server

Preparation

Before we begin, ensure you have the following information ready:

  • Server IP address or hostname
  • Username and password for the user you'd like to connect with
  • A Client, if needed
  • Port number:
ProtocolPort Number
SSH22
FTP, FTPS21
SFTP1122

Connecting to Your Server

Using FTP (File Transfer Protocol) or FTPS (FTP over TLS/SSL)

  • Port: Port 21 is used for both FTP and FTPS.
  • User: Users created via FTPAdmin, nine-manage-vhosts, Linux OS users, and www-data users can use FTP and FTPS.

To connect to your server, you can use the ftp command:

ftp userName@Server-IP_Address

Using SSH (Secure Shell)

  • Port: Port 22 is used for access via the SSH protocol
  • User: Only users created with nine-manage-vhosts and the www-data user

You can simply use the command ssh:

ssh userName@Server-IP_Address

Using SFTP (Secure File Transfer Protocol)

  • Port: Port 1122 and 22 are used for access via the SFTP protocol depending on the kind of user
  • User: the users that are created using FTPAdmin, the users created with nine-manage-vhosts and the www-data user can access

To connect to your FTP server, you have to use the sftp command:

FTPAdmin users:

sftp -P 1122 userName@Server-IP_Address

www-data and nine-manage-vhost users:

sftp -P 22 userName@Server-IP_Address

Access via Client

  • Client: A client should be installed, for example, FileZilla.
  • Protocol: Protocols should be given, for example, if you want to connect via SFTP: sftp://

Connect to your server with FileZilla

FileZilla is a client application that makes connecting to servers via FTP or SFTP a simple task. Follow these steps to connect to your server with FileZilla.

Step 1: Start FileZilla

First, open FileZilla on your local computer (if not installed, you will have to install it). The FileZilla user interface should look similar to the screenshot below.

Image 1

Step 2: Configure the connection details

In the top section of FileZilla, enter the required connection details and click the "Connect" button.

Server: enter the IP or host name of your server. For this example, "saad-test01".

Important: you will to enter the protocol you want to use before the host name or ip:

  • FTP Connection: ftp://saad-test01
  • SFTP Connection: sftp://saad-test01
  • SSH Connection: saad-test01

Username: Enter the username. In this case, we use "saad".

Password: Enter the password of the user

Port: choose the port that you want to connect to:

  • SSH: 22
  • FTP: 21
  • SFTP: 1122

Image 2

Step 3: Access Server Files

As soon as the connection to your web hosting is established, FileZilla displays the server-side directory structure on the right side of the user interface.

Image 3

Access via SCP/SFTP

  • Port: To connect to the server via SCP or SFTP, you must use port 1122.
  • Users: All users set up through FTPAdmin can connect to the server using both FTP(S) and SFTP.

When using scp, the port can be specified with the command line option -P as follows:

scp -P 1122 your_file userName@Server-IP_Address:/path/to/destination/