How To Specify Different Port for Linux Rsync?
We have been attempting to use
rysnc on remote system to backup. But we get network related error. This means we need to enable access to the remote system. But the problem do not solved with this step. Here is the solutions.
Default Rsync Port
Rsync works as a daemon and listen for TCP network port. The default port configuration provided by Rsync daemon is TCP
Specify Rsync Port Explicitly
The first method to change default rsync port is using
--port option with the port number. In this example we will connect remote system port 1234 rsync daemon.
$ rsync --port=1234 ismail@poftut3:/home /mnt/home
Specify Rsync Port In URL
Another method to psecify different port than default is providing the port number in the connection URL. In this example we will specify the port number as
1234 to the
$ rsync ismail@poftut3:1234:/home /mnt/home
Default Ssh Port
Default ssh port is TCP 22 for all ssh servers which is specified in SSH RFC.
Specify Ssh Port Explicitly
We may use ssh tunnel as a secure wrapper. By default we will connect to the remote system port
22 . But this not always the case. If the remote system port is different than
22 we should specify it explicitly. We will use
-e option for this. In thsis exmaple we will connect remote system port
$ rsync -e 'ssh 2222' ismail@poftut:/home /mnt/home