• Skip to primary navigation
  • Skip to main content
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

rsync over ssh port number on Linux/Unix system

May 23, 2014 by Sharad Chhetri Leave a Comment

Question: How may I rsync the files to remote server which has custom ssh port number ?

Answer: To rsync the files and directories with ssh to remote server we use the option -e .
And to define the custom port number with ssh option within rsync command,we use the option -p.

Syntax:

rsync -avz -e 'ssh -p ' source destination

You can see the below given example:

rsync -avz -e 'ssh -p 2560' /opt/backup.tar root@192.168.40.1:~

In above given example:

ssh port number = 2560 (means port number 2560 is used for ssh rather than port no. 22).
source is /opt/backup.tar
root is a user for ssh authentication.Replace root with your available authenticating user.
destination is 192.168.40.1:~ (~ means user’s home directory)

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. rsync all files,hidden files,symlinks,hardlinks to remotes Linux Server
  2. Change the default port number of ssh server
  3. run command in remote linux / unix system by using ssh
  4. How To Find Absolute Full Path Of Command On Linux / Unix : which command
  5. Find exit status code of last executed command on Linux and Unix
  6. 6 important examples of cd command on Linux and Unix Systems
  7. print working directory ( pwd , PWD , OLDPWD ) in Linux / Unix
  8. Linux / Unix : whoami command use and advantage
  9. Head command in Linux / Unix
  10. What is Linux Internal And External Command

Filed Under: Linux, Linux Commands Tagged With: linux command, rsync

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy