Port 873 (rsync)

Port 873 is the default port of the rsync server (rsync daemon), on which the rsync sync tool transfers files between computers without SSH, over TCP.

Key facts

Port
873
Protocols
TCP
Range
System port (Well-Known), 0-1023
IANA service name
rsync

IANA assigns ports in this range to well-known services, under RFC 6335.

About port 873

Port 873 is the default port of the rsync server (rsync daemon), on which the rsync sync tool transfers files between computers without SSH, over TCP. A connection to such a server is written as an address that starts with rsync:// or with a double colon, for example backup.example.com::site.

According to the official rsync documentation, the default port of the server is 873, and IANA registers the port for the rsync service. In most cases rsync runs over SSH, on port 22, and then port 873 isn't needed at all.

What port 873 is used for

  • Mirror sites: mirror sites of Linux distributions and open-source projects let you download and sync files through an rsync server.
  • Backup server on an internal network: servers on the network send copies of files to folders (modules) on a central backup server.
  • Read-only file sharing: an rsync server lets you distribute a folder to several servers, without an SSH account for each of them.

Port 873 in the firewall

When you use rsync over SSH, you don't need to open port 873. When you run an rsync server, allow the port only from the addresses that need access:

  • UFW: ufw allow from 10.0.0.0/24 to any port 873 proto tcp
  • firewalld: firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/24" port port="873" protocol="tcp" accept'

An rsync server used for a public mirror site opens the port to all addresses, with read-only modules.

Risks and security

According to the rsync documentation, an rsync server provides authentication only, without encryption, so files cross the network unencrypted. By default, any address can connect, and any user can connect without a password, so it's important to set the restrictions in the rsyncd.conf file:

  • Limit the allowed addresses with the hosts allow setting.
  • Require authentication with the auth users and secrets file settings, and restrict the permissions of the password file so that only root can read it.
  • Keep modules read-only (the read only setting), which is the default, and allow writing only when it's needed.
  • To transfer sensitive data between servers over a network that isn't private, use rsync over SSH.

Commands to check and configure

  • ss -tlnp | grep ':873 '

    Checks whether an rsync server is listening on port 873.

  • rsync rsync://backup.example.com/

    Shows the list of modules the server publishes.

  • rsync -av /var/www/ rsync://backupuser@backup.example.com/site/

    Transfers the folder's contents to the site module on the rsync server. The password is prompted for separately.

  • rsync -av -e ssh /var/www/ user@backup.example.com:/backup/site/

    Transfers the same folder over SSH, over an encrypted connection and without needing port 873.

  • systemctl enable --now rsyncd

    Starts the rsync server and sets it to start with the server. On Debian and Ubuntu, the service name is rsync.

  • ufw allow from 10.0.0.0/24 to any port 873 proto tcp

    Allows access to the rsync server only from the given internal network (UFW).

  • firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/24" port port="873" protocol="tcp" accept'

    Allows access to the rsync server only from the given internal network in firewalld. Then run firewall-cmd --reload.

Port 873 in the IANA registry

Port Protocol Service IANA registry description
873 TCP rsync rsync
873 UDP rsync rsync

Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)

Port 873 FAQ

Do I need port 873 to use rsync?

No. In most cases, rsync connects to the server over SSH, on port 22, with the same user that logs in to the server. Port 873 is needed only when you run a dedicated rsync server.

What's the difference between rsync over SSH and an rsync server?

Over SSH, the connection is encrypted and authentication uses the user account on the server. On an rsync server, access is set per module, with separate usernames and passwords, but the connection isn't encrypted. An rsync server is mainly suited to mirror sites and internal networks.

What does the double colon in an rsync address mean?

An address with a single colon, such as server.example.com:/backup, connects over SSH. An address with a double colon, such as server.example.com::site, connects to the rsync server on port 873, to the module named site.

How do I restrict access to an rsync server?

In the rsyncd.conf file, set for each module the allowed addresses (hosts allow), the allowed users (auth users), and the password file (secrets file). In addition, allow port 873 in the firewall only from those same addresses.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement