How to connect FTP and SFTP via Terminal and Filezilla

Introduction :

File Transfer Protocol (FTP): File Transfer Protocol (FTP) is a standard network protocol for file exchange between clients and servers. Operating on a client-server model, FTP can’t have built-in encryption, making data susceptible to security risks. Despite its simplicity and widespread use, FTP may not be ideal for transferring sensitive information due to its inherent security vulnerabilities.

Secure File Transfer Protocol (SFTP): Secure File Transfer Protocol (SFTP) is a secure alternative to FTP, addressing its encryption shortcomings. SFTP, an extension of the SSH protocol, encrypts both commands and data, ensuring confidentiality and integrity during transmission. Widely adopted for secure file transfers, SFTP operates over a secure connection and has become a standard in environments where safeguarding sensitive data is a top priority.

Prerequisites :

  1. FTP and SFTP server address
  2. Username and password
  3. PORT Number if it is varied with the default port number.
  4. Verify that your user account has the necessary permissions to access files on the server.

Implementation:

FTP

Method 1: Using Terminal 

Run the FTP Command in your terminal

  $ ftp <server_address>

If the FTP server is configured to a different port run the FTP Command in your terminal

 $ ftp -p <server_address> <port_number>

Enter FTP Username

It will prompt you to enter the FTP username. Type your FTP username and press Enter.

 $ Name (server_address:user): ftp_username

Enter FTP Password

Next, it will be prompted to enter the FTP password. Type your FTP password and press Enter.

 $ Password: ftp_password

Method 2: Using Filezilla

Install and open the Filezilla application.

Host: ftp.domain.com (ftp://server_address)
Username: Enter the FTP username (Same as your hosting account username or the FTP account you created) 
Password: Enter the FTP password (Your FTP account password)
Port: The Default port is 22 or otherwise enter your configured FTP server port.

SFTP

Method 1: Using Terminal 

Run the SFTP Command in your terminal

  $ sftp username@server_address

If the SFTP server is configured to a different port run the FTP Command in your terminal

 $ sftp -P <server_address> <username@server_address>

Enter SFTP Password

Next, it will be prompted to enter the SFTP password. Type your SFTP password and press Enter.

 $ Password: sftp_password

Method 2: Using Filezilla

Install and open the Filezilla application.

Host: sftp.domain.com (sftp://<server_address>)
Username: Enter the SFTP username (Same as your hosting account username or the SFTP account you created) 
Password: Enter the SFTP password (Your SFTP account password)
Port: The Default port is 23 or enter your configured FTP server port.

Note :
Remove with
1.  “server_address” with the IP address or hostname of the remote server.
2. “username”  with your actual username.
3. “password” with your actual password.

Conclusion

FTP and SFTP provide convenient methods for transferring files between a local system and a remote server. However, SFTP is recommended for secure file transfers because it encrypts the connection and protects credentials and data during transmission. When using either method, ensure that the correct server details, credentials, port number, and user permissions are configured.

FAQs

1. What is the difference between FTP and SFTP?
FTP transfers data without encryption, while SFTP transfers files through an encrypted SSH connection.

2. Which port is used by FTP?
FTP commonly uses port 21 for control connections. The data connection may use additional ports depending on the FTP mode.

3. Which port is used by SFTP?
SFTP commonly uses port 22, unless a custom SSH port has been configured on the server.

How to use the key pair to login into FTP

How to create an SFTP account in the Plesk Panel

How to upload file in your account via FTP filezilla in cPanel

Talk to our experts:

Looking for the right technology solution for your business?. Our experts can help with web hosting, domain registration, DevOps and cloud, software development, web applications, mobile applications, and enterprise solutions. Get in touch with our team here.

ajith kumar

Writes about Web & Architecture at Pheonix Solutions.

Leave a Reply

Scroll to Top