ItSolutionStuff.com

How to Use Rsync with Specific Port in Linux?

By Hardik Savani • October 13, 2022
Ubuntu

Hey Guys,

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...

Tags: Ubuntu
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Generate and Add SSH Key in Github?

Read Now →

How to Generate SSH Key in Ubuntu Server?

Read Now →

How to Whitelist/Allow IP Address in Apache Ubuntu?

Read Now →

How to Restrict/Block IP Address in Apache Ubuntu?

Read Now →

How to Install Composer in Ubuntu Server?

Read Now →

How to Install Apache Web Server on Ubuntu Server?

Read Now →

How to Reliably Keep an SSH Tunnel Open in Server?

Read Now →

How to Connect SSH using ppk File Ubuntu?

Read Now →

SSH Command to Connect to Server using Pem File Example

Read Now →

How to Connect to a Remote Server using SSH on Ubuntu?

Read Now →

How to Change GitHub Remote from HTTPS to SSH?

Read Now →

How to Enable Apache mod_rewrite Module in Ubuntu?

Read Now →

How to Connect SSH using PHP?

Read Now →

How to Upload File to Linux Server from My Computer?

Read Now →