


sftp> pwd – Display remote working directory.sftp> cd path – Change remote directory to ‘path’.Let’s look at some of the examples of SFTP commands: Most of these commands resemble basic shell commands for navigation, file and directory creation, etc. This will list all the possible SFTP commands, but we want to look at only a couple of them. Let us login to the remote machine using the SFTP command and start an SFTP session and run the ? or help command: ❯ sftp password: SFTP uses the SSH (secure shell) for securing the connection. SFTP or secure file transfer protocol is an upgrade from the traditional FTP (file transfer protocol). In this example, we have used the root user, but please make sure that your user has the write permission on the remote server. The directory contains one file netflix_, which we will transfer to the remote machine using the SFTP command.

Exit the remote machine and hop back to your local machine and list the files and subdirectories in the current directory: ~]# exit If you have provisioned a new server, there will be no files in the root directory. To ensure that no files exist on your remote server, check your current directory and list the content of the directory: ~]# ~]# ls Last login: Fri Feb 26 14:28:52 2021 from ~]#Īlternatively, you can generate SSH keys (public and private key pair) for authentication and log into the remote server using that. If you don’t have a remote system, quickly provision a remote server on Windows or Linux and log in using your root (user name) and password for authentication: ssh password: For this example, you would need a local and a remote system in place. SSH creates a secure connection between two systems. See Also: (Live Webinar) Meet ServerMania: Transform Your Server Hosting Experience In the examples, we will use a sample file netflix_ hosted on our local machine, and we will securely transfer it using SFTP. The command line provides other alternative file transfer capabilities such as SCP, which also uses the SSH (secure shell) under the hood. In this article, we will show you how to securely transfer files between your local machine and a remote machine, using SFTP (Secure File Transfer Protocol), also known as the SSH File Transfer Protocol.
