About Linux FAQ

Browse More FAQs:

Linux or UNIX securely copy files across a network computer

Posted by Vivek Gite [Last updated: August 24, 2007]

Q. FTP is insecure, how do I securely copy files across a network computer? My network has Windows and Linux systems.

A. You need to use Openssh client and server technology to copy between two more network computers. You can also find free ssh client tools. scp copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security as ssh.

Copy from Linux to Linux/UNIX system

Copy file called data.txt to ras.nixcraft.in Linux system (vivek is username):
$ scp data.txt vivek@ras.nixcraft.in:/home/vivek

Copy more than two files:
$ scp data.txt pic.jpg vivek@ras.nixcraft.in:/home/vivek
Copy /data directory and all files inside /data i.e. recursively copy entire directories:
$ scp -r /data vivek@ras.nixcraft.in:/home/vivek

Copy from Windows to Linux/UNIX system

You can download any one of the following free Windows SCP client

Just install above client and follow on screen instructions.

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Discussion on This FAQ

  1. Perfect tool over remote ssh session for downloading large file. « Security Engineering Says:

    [...] On the other hand, just upload a newly build axel binary to remote Linux server using scp. [...]

  2. Todd Says:

    Is there a way to copy multiple files to multiple servers? I’ve tried putting in a space and the location of the other server but no luck.

  3. vivek Says:

    Todd,

    You can copy multiple files to multiple servers using shell for loop:

    SERVERS="user1@box1 user2@box2 user3@box3"
    for s in $SERVERS
    do
      scp file1 file2 ${s}:/path
    done
  4. Raj Says:

    you could also use it without a script.

    for i in 1 2 3; do scp file1 file2 user@box$i; done

  5. Raj Says:

    Actually it would be better if you could generate the ssh. keys and add it to your client machines.

  6. Arun Says:

    Is it possible to send password in the same line?
    As in ftp we use, user/password@host . We cant disturb the remote machine for moving public key files. Thats why.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

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

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.