rsync to non standard port

It’s a long time since I don’t write on my blog… so just a simple post to help me remember a non standard rsync command syntax.

rsync is a powerful synchronization tool, that could help to perform a fast-and-secure backup of files and folder to a remote server. Usually rsync uses ssh to connect to the remote server, thus transfers are secure. But rsync relies on standard ssh configuration to connect to that server. What happens if you changed, for instance,  ssh daemon listen port?

rsync has a command line option to specify what kind of remote shell you would use to connect to the server. This way you can specify the non standard port to connect to. Say you want to transfer all *.tar.gz files from local directory to the remote server myremoteserver, using ssh shell connecting to port 1234 with user user. The command line you have to use is the following:

rsync --progress -vrae 'ssh -p 1234' *.tar.gz user@myremoteserver:/path/to/remote/directory

The only pitfall on this command is you’ll be asked for a connection password, so you cannot schedule this command to be executed automatically. But I know there is a way to logon automatically, providing the local system with a certificate to access the remote system. I’ll write more on this in the next day.

Advertisements

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: