10 sFTP Command Examples to Transfer Files on Remote Servers in Linux

If you have any questions or problems regarding this article and want help within 24 Hours? Ask Now

Support TecMint: Did you find this tutorial helpful?. Please help to keep it alive by donating. Every cent counts! - Donate Now

Narad Shrestha

He has over 10 years of rich IT experience which includes various Linux Distros, FOSS and Networking. Narad always believes sharing IT knowledge with others and adopts new technology with ease.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

16 Responses

  1. Neha says:

    I wanted to know if we have any way to enable the SFTP in ascii mode.I have read online that ascii mode in SFTP is supported sftp v4 onwards, can you please help me to find out as in how can I set the transfer mode to ascii in SFTP??

    Thanks a lot in advance.

  2. Rathi says:


    I need to transfer files from one server to another server.Is it possible using sftp?

    • Ravi Saive says:

      Yes it’s possible….use winscp or ftp client to do so…or you can use command line tricks as described in the article..

  3. Parag says:

    Hello. On one of my server SFTP command is non- recognizeable
    While FTP is working fine. What I need to do for this

  4. David Juma says:

    Thanks alot. This post helped me move lots of files remotely. I like the simplicity and the approach in whole article. Keep Up!

  5. Farhan Islam says:

    1 Important thing you forget to include

    For those having SFTP/SSH on different port can use below

    sftp -oPort=3476 user@host

    Where 3476 is port number.


  6. Seva says:

    I want to transfer an entire folder from one linux machine to another linux machine.
    Please let me know the command for the same.

  7. david says:

    sftp will not pass along a password as a parameter and you cannot script reading the password. You must either manually enter the password or use RSA keys to bypass using passwords. Search for “sftp rsa key password” and you will find many examples of how to do this. (This drove me crazy when I was first learning sftp, I was used to scripting the password for ftp).

    • Rajesh says:

      ssh-keygen -t rsa
      cd .ssh
      u have show the public key
      scp publickey oracle@sys2:/tmp
      u have cp the torget file have 1777 permessions
      k u have go to another system
      cd .ssh
      cp /tmp/publickey authorized_keys
      service sshd restart
      go to sys1
      ssh sys2
      do not ask the passwd

  8. rp says:

    use sftp –password=”passboss”

  9. Kamal says:


    Generally it will prompt to enter password if we enter SFTP command.
    Is it possible to enter the password into the SFTP command so that I do not see a prompt again asking for password.

    Could you please suggest the syntax,

    My SFTP command is like this, then it will ask for a password say ‘passboss’
    sftp -o StictHostKeyChecking=no -oProxyCommand=’/usr/bin/nc -abcdef.kk.lmmm:1080 %h %p’ user@kkkk.jjjjj.com 22

    Could you please add the password in the above syntax so that it will not prompt again.

    eagerly awaiting ur reponse.


Leave a Reply

Your email address will not be published. Required fields are marked *

Join Over 95000+ Linux Users
  1. 57,739
  2. 3,201
  3. 25,639

Enter your email to get latest Linux Howto's