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

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

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.

Host Your Own Website at $97 Discount + One Free Domain Using our Promo Code 'Tec97' (Enter this code during Signup) - Signup with DreamHost Now!

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

You may also like...

14 Responses

  1. 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..

  2. 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

  3. 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!

  4. 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.


  5. 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.

  6. 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

  7. rp says:

    use sftp –password=”passboss”

  8. 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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Join Over 62000+ Linux Users
  1. 48100
  2. 2222
  3. 11697
Enter your email to get latest Linux Howto's