Vexxhost: Rsync via SSH using Lxc 14.04LTS Server
Prerequisites:
The below assumes that SSH access at Vexxhost – including getting Vexxhost to actually enable SSH on your account – has been setup. It also assumes that the Private/Public Key (~/.ssh/[sshkey]) as been created and installed. (Public Key only on the Vexxhost server.)
This document uses the following placeholders:
[sshkey] ← replace with the Key File used to access the Vexxhost Cloud Sites hosting account
[remoteuser] ← the hosted user account (@ Vexxhost) for this ssh key
[remoteserver.tld] ← the domain name for the account/server hosted at Vexxhost
Use SSH and Rsync from an UbuntuCloud Lxc Container:
eval "$(ssh-agent -s)" # start the ssh-agent in the background
ssh-add ~/.ssh/[sshkey] # will need to type in the key pass-phrase (if any)
An example to Rsync a DokuWiki site from Vexxhost to an UbuntuCloud Lxc webserver:
sudo chown ubuntu:ubuntu -R /var/www/html
rsync -av --exclude="cache/*/" -e ssh [remoteuser]@[remotehost.tld]:/home/[remoteuser]/public_html/dir/ /var/www/html/this/dir
sudo chown www-data:www-data -R /var/www/html
To Copy a Single File (using scp) :
To copy a file from the Lxc container to the site at Vexxhost while logged into the Lxc container:
scp /path/to/file [remoteuser]@[remoteserver.tld]:/path/to/destination
To copy a file from the site at Vexxhost to the Lxc container while logged into the site at Vexxhost:
scp [remoteuser]@[remoteserver.tld]:/path/to/file /path/to/destination
Reference: Stack Exchange: How to copy files from one machine to another using ssh [duplicate]