How to Use Rsync with Specific Port in Linux?
This tutorial will give you an example of how to use rsync with specific port in linux. We will use rsync specify port number. In this article, we will implement a rsync set port number ssh. I would like to share with you rsync specify port with ssh. Alright, let us dive into the details.
Sometimes, we need to download or upload data on server then we will use rsync for Linux server. But if when you connect to a server then you need to use ssh with a specific port then how you will do it? Yes, I will help you with it. You can also use the port number with Rsync ubuntu command.
So, let's see the solution below:
rsync without Port
rsync -avz /path/local/files root@:0.0.0.0:/path/on/my/server
rsync with Specific Port
We will add -p option to specify port number.
rsync -rvz -e 'ssh -p 18765' --progress /path/local/files/uploadZipFile.zip root@:0.0.0.0:/www/example.com/uploadZipFile -p 18765
/path/local/files: this is the path of local file that you want to upload on server.
root: this is a username of your linux server.
0.0.0.0: this is a ip address of your linux server.
/www/example.com/uploadZipFile: this is the path of server folder where you upload file on server.
-p: specify port number.
I hope it can help you...
We are Recommending you
- How to Generate and Add SSH Key in Github?
- How to Generate SSH Key in Ubuntu Server?
- How to Whitelist/Allow IP Address in Apache Ubuntu?
- How to Restrict/Block IP Address in Apache Ubuntu?
- How to Install Composer in Ubuntu Server?
- How to Install Apache Web Server on Ubuntu Server?
- How to Reliably Keep an SSH Tunnel Open in Server?
- How to Connect SSH using ppk File Ubuntu?
- SSH Command to Connect to Server using Pem File Example
- How to Connect to a Remote Server using SSH on Ubuntu?
- How to Change GitHub Remote from HTTPS to SSH?
- How to Enable Apache mod_rewrite Module in Ubuntu?
- How to Connect SSH using PHP?
- How to Upload File to Linux Server from My Computer?