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.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 15 comments… read them below or add one }
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.
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 doneyou could also use it without a script.
for i in 1 2 3; do scp file1 file2 user@box$i; done
Actually it would be better if you could generate the ssh. keys and add it to your client machines.
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.
I found this
http://toic.org/mscp/
to be very helpful when you need to scp files to multiple hosts.
Hi vivek,
thank you for sharing all that in all the really goods post, article and tip/tricks. I’m not a sysadmin and your site has help me a lot those past moths for managing my server. Thanks !
yes! very nice site !! thank you!
hi
I am a new user to linux and just wanna noe how to share files in a network btw linux to linux machines or linux to windows
hoping for some quick response
When i try to copy a file from one server to another server using rcp command, i get error permission denied & if i use command scp, then it gives error connection lost whereas the server is pingable.
Hi All,
This is all clear. But, if i want to copy single file to multiple destination using scp How can we do that ?
If possible, Can anybody send me syntax for that.
Thanks in advance.
Best Regards,
Shameem.
I connect to a network in three steps. Then how can I copy files to my machine home directory ?
nice post thanks alot………:)
source:root
Dest:user account
how copy a file from root mechine to user account in diff computer……..
Hi
i wanna copy a file from Linux to windows by using rdesktop please help me
Thanks in advance