Login

Please fill in your details to login.





secure copy from server to server

This page is mainly about secure copy from server to server
I recently commissioned a shiny, new VPS (Virtual Private Server) to host this website (and a couple of other websites that I have). I started to transfer/migrate the content across from the old, shared hosting I was using to this new server manually by downloading it to my desktop and then reuploading it. It was sooooo slow. Then, after a little research discovered that I could use SCP (Secure Copy Protocol) to transfer the content directly from one server to another. Noice.

Prerequisites

SSH installed on both servers
SCP installed on the destination server
Port 22 open on both servers (although the source server used port 722 for SSH)
Access to the root user on the destination server
Knowledge of the location of the website/vhosts files on the destination server
Access to a user for the remote server.

$ apt-get install sshpass
$ sshpass -p "password" scp -r -P 123 user@server:/path/to/source/folder /path/to/destination/folder 

Last modified: October 5th, 2021
The Computing Café works best in landscape mode.
Rotate your device.
Dismiss Warning