Sooner or later you need to get files onto the server: a site build, a database dump, a config you wrote locally. You don't need an FTP server for this — SSH already gives you three good tools. All examples use documentation addresses; replace them with your server's.
Know your connection details
- Dedicated-IP plan:
root@203.0.113.10, port 22. - NAT plan: the host and your personal SSH port are shown in the dashboard (for example port 20123). Every command below needs that port — see how NAT access works.
scp: copy a file or folder
Upload a file:
scp backup.sql root@203.0.113.10:/root/
Download one:
scp root@203.0.113.10:/var/log/nginx/access.log .
A whole folder:
scp -r ./site root@203.0.113.10:/var/www/
On a NAT plan, add the port with a capital -P:
scp -P 20123 backup.sql root@your-nat-host:/root/
rsync: the right tool for folders
rsync sends only the differences, shows progress and resumes if the connection drops. It must be installed on both ends (apt install -y rsync).
rsync -avzP ./site/ root@203.0.113.10:/var/www/site/
-akeeps permissions and timestamps,-vlists files,-zcompresses,-Pshows progress and allows resuming.
With a custom SSH port:
rsync -avzP -e "ssh -p 20123" ./site/ root@your-nat-host:/var/www/site/
To make the destination an exact mirror (deleting files you removed locally), add --delete — but preview first:
rsync -avzP --delete --dry-run ./site/ root@203.0.113.10:/var/www/site/
Mind the trailing slash. ./site/ copies the contents of site; ./site copies the folder itself into the destination. With --delete, that difference decides which directory gets emptied.
SFTP: interactive or graphical
The command-line client works like a tiny file manager:
sftp -P 20123 root@your-nat-host
sftp> put backup.sql
sftp> get /etc/nginx/nginx.conf
sftp> exit
Prefer a GUI? FileZilla, WinSCP or Cyberduck connect with the same details: protocol SFTP, your host, port 22 (or your NAT port), user root, and your SSH key or password.
Faster with SSH keys
Every tool above uses SSH, so an SSH key means no password prompts — and lets you script transfers from cron. If you haven't set one up yet: SSH key authentication. New EQVPS servers accept the root password from the dashboard until you switch to keys, which we recommend doing on day one.
Big transfers
For tens of gigabytes, rsync is the only sane choice: if the connection drops, run the same command again and it continues where it stopped. Run it inside tmux or screen on the machine that sends, so closing your laptop doesn't kill it.
Comments
No comments yet. Be the first.