Accessing Files on Your VPS Using SFTP with FileZilla Client
Overview
In this guide, we’ll focus on using SFTP (SSH File Transfer Protocol) for easy, fast, and secure file transfers to and from your VPS server. Unlike alternatives such as NFS and FTP, SFTP doesn’t require additional software installation on your VPS, simplifying the process. It’s important to note that SFTP is not FTP over SSH; rather, it’s an extension of SSH v2.0, offering a secure file transfer solution.
With SSH v2.0 enabled on your VPS (typically enabled by default) and a functioning SSH client, if you can SSH into your VPS, SFTP is ready for use. This makes SFTP an accessible, secure, and efficient choice for file transfers without the need for complex configurations.
Requirements
The provided guide is applicable to various Linux systems, with CentOS 7.4 being used as a reference.
Your Windows machine will serve as the client for accessing the VPS.
It is highly advisable to adhere to the hardening guide [1] for securing your CentOS VPS. Additionally, it is recommended to establish key-based access rather than relying on password-protected SFTP connections. Most clients, including FileZilla, support this more secure method of authentication.
Selecting the Right Client
When it comes to selecting a client for a secure SFTP connection, various options are available, including WinSCP[2], PuTTY SFTP client (PSFTP)[3], SmartFTP[4], and FileZilla[5].
Opting for FileZilla[6] is advantageous for several reasons. Known for its speed, widespread usage, and user-friendly interface, FileZilla stands out as a reliable choice. Below, I’ll guide you on configuring FileZilla to establish a secure SFTP connection, leveraging its efficiency and popularity.
Establishing a Safe Configuration
By default, connecting to your VPS server using FileZilla is a straightforward process. Simply launch FileZilla, enter your VPS server’s IP, provide your login/password, and specify the port (usually set to 22 by default). This grants you immediate access to your VPS over the SFTP protocol.
However, for enhanced security, it is highly recommended to follow a hardening guide[7]. This guide will walk you through the process of generating a key pair, adding an extra layer of security to your VPS access. Once the keys are set up, we can proceed with configuring FileZilla for a more secure SFTP connection.
Filezilla Installation Guide
Open FileZilla and navigate to Edit -> Settings. In the left menu, select SFTP, click on ‘Add key,’ and choose the private key generated using PuTTY tools.
Navigate to File -> Site Manager. Within the Site Manager, click ‘New Site‘ and assign a name. In the right menu, under the General tab, input your VPS server’s IP, set the port (default is 22), and select ‘SFTP‘ from the Protocol drop-down menu.
From the Logon Type menu, select ‘Interactive,’ and input your VPS server access username, typically ‘root’ in many cases, for which you have generated a key.
Once configured, click ‘Connect.’ If your SSH key is password-protected, a prompt will appear, requesting you to enter the password.
There’s no requirement to convert the key, as was the case in previous FileZilla versions, or to run additional background tools. The next time you wish to connect to your server through FileZilla, simply launch the tool and select your server from the dropdown menu in the Site Manager, located below the ‘File‘ button.
Simply click on the name of your server, and FileZilla will automatically establish a connection to your VPS.
FileZilla also provides the capability to edit text files on your VPS server. To do this, navigate to the file in the FileZilla menu, right-click, and select ‘View/Edit.’ The first time you do this, FileZilla will prompt you to choose a text editor (with Windows Notepad as the default). Subsequently, it will automatically open the file with your last choice. You can change this preference in the future by going to ‘Edit‘ -> ‘Settings‘ -> ‘File Editing.’
In Summary
Now you have the knowledge to efficiently upload and download files from your VPS server and even edit text files if necessary. It’s worth noting that securing your SSH connection not only enhances general security but also enables you to set up a secure SFTP connection. Therefore, it is advisable to consider implementing these security measures.
[1]: https://www.blendhosting.com/kb/setting-up-a-safe-ssh/
[2]: https://winscp.net/eng/docs/start
[3]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
[4]: https://www.smartftp.com/en-us/
[5]: https://filezilla-project.org/client_features.php
[6]: https://filezilla-project.org/client_features.php
[7]: https://www.blendhosting.com/kb/setting-up-a-safe-ssh/