How do I securely transfer files from one UNIX / Linux server to another UNIX server using Windows or Linux desktop clients without using ftp client?

You need to use secure sftp or scp client for Windows XP / Vista / 7. Under Linux or Apple Mac OS X desktop you can use regular OpenSSH scp / sftp client to transfer files.

Advertisement

Windows SSH Client

You can use free SFTP, FTP and SCP client for Windows called putty or winscp.

Windows Winscp transfer files from one UNIX / Linux server to another

Fig.01: Winscp transfer files from one UNIX server to another (image credit Winscp website)

Linux / UNIX / OS X SSH scp Client Examples

Use the following command from the server to which you want the files to go. In this example, transfer all files (/var/www/html) from remote server called server1 to local directory called /backup:
scp -r user@server1:/var/www/html/ /backup
In the following example, transfer all files (/var/www/html) from remote server called server1 to another server called server2:
scp -r user@server1:/var/www/html/ user@server2:/var/www/html/

Say hello to rsync

I recommend using rsync command which will only push or download updated files. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. In this example, copy files from remote server called server1 into /backup directory:
rsync -avz -e ssh user@server1:/var/www/html /backup

See also:

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

27 comments… add one
  • Jegadheesh Dec 14, 2012 @ 17:04

    Thanks, It worked for me..

  • Chirag Jun 18, 2013 @ 12:44

    Thanks Alot!!!!!!!!!!!!!!!! :) :) :):) :)

  • Aamir Jul 1, 2013 @ 11:54

    I have 2 unix boxes. 1 is source and 2nd is destination. I am using a windows machine. My 2 unix boxes can not connect to each other due to security issues. Currently I copy from 1 unix box to windows and then transfer it from windows to 2nd unix box. How can I automate this process? Can I have such script to run on windows?

Leave a Reply

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

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.