How do I copy files from one domain name to another using the shell?

This page is showing a generic answer.
To see a more detailed answer customized for you, type your domain name here:

If you have multiple domain names hosted with us, we assign each domain name a different Unix user ID to prevent cross-site contamination.

However, occasionally customers who use the command-line shell need to copy files between those domain names using rsync or other SSH tools.

While you can simply type the password on the shell command line, you can also use SSH keys to avoid that.

To do this, create a key on the “source” domain name you’ll be connecting from by typing ssh-keygen -t rsa and saving it without a password, like this:

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ex/
Created directory '/home/ex/'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ex/
Your public key has been saved in /home/ex/

Then copy the contents of the new “” key to the “destination” server. An easy and safe method is to display the contents of the file on the source server by typing something like less ~/.ssh/, then selecting the displayed text and copying it to your clipboard.

What you copied should look something like this example:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0X5UPVf+m8a2+X0iSKoqiCKvWw3U5i9yod

Now login to the shell of the “destination” domain name and add that public key (as a single line) to the file ~/.ssh/authorized_keys. You can create the directory and edit the file from the shell with these commands:

mkdir -p ~/.ssh
editor ~/.ssh/authorized_keys

After doing this, you should be able to connect from the source domain name to the destination domain name without a password, using:


Commands that use SSH as the underlying protocol, such as “rsync” and “scp”, should also work, such as:

rsync -av directory

scp file