Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | No |
Requirements | None |
Time | 1m |
rsync -av -e 'ssh -p PORT-NUMBER-HERE' /path/to/source user@backup1.example.com
Use a different ssh port when using rsync
In this example, I am going to backup /home/vivek/ directory to the server called server1.nixcraft.net.in at TCP port number 5000, enter:
rsync -av -e 'ssh -p 5000' /home/vivek backupop@server1.nixcraft.net.in
See also:
- Man pages: ssh(1)
🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.
🐧 5 comments so far... add one ↓
🐧 5 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
I faced this problem some time ago..but I sorted it out myself after reading the man pages ..lol.
wish this post was made sometime ago :D
We dont use a remote shell, but I need to specify what port the client starts the request on – as well as what port the remote host is listening on. Is that possible?
For security reasons, we want to allow rsync, but the “random port” from the client is causing me issues.
clarification – we dont use a remote shell with rsync. here is the basic command we use in our scripts:
rsync –verbose user1@5.2.2.5::user1
thanks man!!!!
Thanks Vivek! Please get on Gittip.com so we can pay you!