See also: Best Free SFTP Servers
SFTP is often mistakenly referred to as Secure File Transfer Protocol, however, it actually means “SSH File Transfer Protocol.” This system is a secure method for transferring files between systems by encrypting both the files and the connection itself, ensuring data integrity and confidentiality. SFTP creates a secure link but then allows files to be exchanged with the standard FTP (File Transfer Protocol) – a pre-existing and well-established system for file movements. Thus, you get a reliable file transfer system but with extra security.
It’s important to note that SFTP, like FTP, is not a standalone program but a standardized protocol. This means developers must adhere to the SFTP specification when creating software to ensure compatibility across different implementations. As a result, various SFTP client and server applications exist, all designed to follow the same protocol to facilitate seamless file transfer.
In a typical setup, SFTP operates through a command-line interface (CLI). Upon initiating an SFTP session, users enter a distinct environment where the command prompt changes to display sftp>. This indicates that the session is active, and users must now rely on SFTP-specific commands rather than the usual operating system commands. These commands, which are part of the SFTP protocol standard, allow users to navigate directories, upload or download files, and manage remote file systems securely, making SFTP an essential tool for encrypted file transfers in modern IT environments.
Most frequently used SFTP commands
Some most commonly used SFTP commands include:
Command | Description |
---|---|
? | List of all commands or explain a command, eg ? get |
! | Leave the environment temporarily * |
cd | Change the active directory path on the remote host |
chmod | Change the permissions of files on the remote host |
chown | Change the owner of files on the remote host |
dir | List the contents of the current directory on the remote host |
exit | Close the connection and leave SFTP |
get | Copy a file from the remote host to the local computer |
help | Same as ? |
lcd | Change the active directory on the local system |
lls | List the contents of the current directory on the local computer |
lmkdir | Create a directory on the local computer |
ln | Create a symbolic link for a file on the remote host |
lpwd | Show the present working directory on the local computer |
ls | Same as dir |
lumask | Change the local umask value |
mkdir | Create a directory on the remote host |
put | Copy a file from the local computer to the remote host |
pwd | Show the present working directory path on the remote host |
quit | Same as exit |
rename | Rename a file on the remote host |
rm | Delete a file on the remote host |
rmdir | Remove an empty directory on the remote host |
symlink | Same as ln |
version | Show the SFTP version |
* to return to SFTP type exit. Execute commands in the underlying operating system without leaving SFTP by putting ! in front of the command, eg !date
SFTP implementations
Not every computer will have an SFTP program, but just about all computers do have FTP. For example, FTP is bundled into all Microsoft operating systems, but SFTP isn’t. There are also GUI versions of SFTP available and they take care of all of the available commands for you through interpretive buttons and menu options. Whether you prefer a GUI SFTP implementation or you want to use the system at the command line, you will need to find and install an SFTP utility.
Do you have a favorite SFTP program that you use a lot? Leave a message in the comments section below and let us all know about it.
View or Download the Cheat Sheet JPG image
Right-click on the image below to save the JPG file (759 width x 860 height in pixels), or click here to open it in a new browser tab. Once the image opens in a new window, you may need to click on the image to zoom in and view the full-sized jpeg.
View or Download the cheat sheet PDF file
Download the cheat sheet PDF file here. When it opens in a new browser tab, simply right-click on the PDF and navigate to the download menu.
SFTP Commands FAQs
⭐ What is a good SFTP server?
Files.com is a cloud file management service that acts as a file transfer hub that sports an in-built FTP and SFTP server. It uses SFTP to pass files securely between client computers and the client account storage space. You can mount an external SFTP site directly into Files.com as a folder or configure syncs on a schedule.
Pros:
- Puts security at the forefront of their product, making this a reliable cloud-based option for long term use
- Multiple transmission protocol support can be integrated into virtually any existing application or service
- Robust user management and auditing makes this tool one of the best options for enterprise use
- Includes features such as receive receipts and links that expire, which help provide additional insight and control when sharing files with third parties
- Scalable pricing makes this a great option for businesses of all sizes
Cons:
- Trial time could be longer
Once a file is resident on the server it can be distributed many times over without having to transfer the file again – the user emails the recipient a link for direct secure access on the Files.com server instead. Start a 7-day free trial.
Another service that you could examine as an alternative to Files.com is ExaVault. This provides a cloud storage area that can be subdivided into user accounts. It is also possible to set up a system account to receive files sent through SFTP – FTPS is also possible.
Pros:
- Suitable for use as a primary file server
- Offers user controls to grant access to files
- Access rights can be time limited and can also be revoked
- Acts as an SFTP server and an FTPS server
- A good system for businesses with many home-based employees or multiple sites
Cons:
- No free tier
The platform cuts down the need for file transfers because the space it offers can be used as the primary file server for your business. It is also possible to distribute files by sending a link for access rather than actually moving the file. Keeping the files in one place enables all activity on them to be logged for compliance auditing. You can a 30-day free trial of the ExaVault service.
If you prefer to run an SFTP system on your own server, you could look at the Cerberus FTP Server package. This system installs on Windows or Windows Server and it provides a Web-based client, so you don’t need to install a client application on each of your company workstations.
This system will access your Active Directory implementation to check on user accounts and higher plans will link through to Okta to create a single sign-on environment.
What is needed for SFTP?
An SFTP connection requires appropriate software, so you will need an SFTP server utility on one of the two devices in communication and a client at the other end. Most SFTP utilities provide both functions.
Why doesn't the CHMOD command work on all FTP or SFTP servers?
The developer of an FTP server utility can create the service in any way, but the software will only be able to work universally interacting with other devices that don’t need to have the same software installed on it, if the developer follows the common FTP standards. All FTP utilities will include all of the commands stipulated in the relevant RFCs and then will possibly also have extra functionality. CHMOD is not specified in the FTP standards and therefore, it is an optional extra that some developers program into their software. It doesn’t have to be included in every implementation.
How do you grep via SFTP?
The grep shell command isn’t built into the standard SFTP environment, so in order to use grep on a remote file, you will need to transfer the file to the local computer with SFTP and then perform a grep.
See also: SolarWinds SFTP/SCP Server review & SFTP Commands Cheat Sheet
Image: Server web secure by RRZEicons via Wikimedia Commons. Licensed under CC BY-SA 3.0