How to transfer files using SFTP

Home > Search > How-to
  by

This assumes you already have a working SSH server. On a client computer in the LAN, type sftp following by the user account you want to connect as and the domain name or IP address of the SSH server.  For example, sftp jeremy@example.com.  If the connection is successful, you will be prompted to enter the password.  If the password is verified, you will get an interactive sftp> prompt.

Let's say you have a a file on your client, such as C:\users\username\Downloads\samplefile1.txt, and you want to transfer this file to /srv/samba/share on the SSH server. Use the lcd (local change directory) to change to the C:\Users\username\Downloads folder on the client.

sftp > lcd C:\Users\username\Downloads

 

Use the cd (change directory) to change the the /srv/samba/share directory on the SSH server.

sftp > cd /srv/samba/share

 

Use the put command to transfer the samplefile1.txt file from the client to the server.

sftp > put samplefile1.txt

 

Use the ls (list) command to verify that the samplefile1.txt file was successfully transferred to the server.

sftp > ls
-rw-rw-r--    1   jeremy  jeremy   0   Dec 4  19:07   samplefile1.tx

 

Use the exit command to disconnect from the SSH server.

sftp > exit

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments