Bobcares

Rsync ‘Permission denied’ for root – Top 4 reasons and solutions

by | Feb 25, 2019

Rsync is a great tool for replicating a single file to entire filesystems.

It always provides smooth data transfer. But, it’s quite common to get frustrated with rsync.

One such frustrating error is “rsync permission denied for root“.

At Bobcares, we help server owners resolve such errors as part of our Server Management Services.

Today, let’s see the top 4 reasons for this error and how we fix them.

Rsync permission denied for root – What’s this?

The error Permission denied means that the user doesn’t have permission on this file. One of the common scenarios where customers usually face this error is when they try to use the rsync command for replicating the data, transfer the data from local server to remote, etc.

For instance, below is one of the common errors that customers see related to the permission problems.

rsync: mkstemp "/xx/xx/xx/xx/xx" failed: Permission denied (13)

 

In such cases, our Support Engineers recreate the problem by using the rsync command in debug mode(-v switch). For example, see the below command.

rsync -avzh /home/ vps:/home

 

Rsync permission denied for root – Top causes & Fixes

Now, let’s discuss the major reasons for this error and how our Dedicated Engineers fix them.

1) Root login disabled

It’s a common security practice that server owners disable direct root login on the servers. For example, on Linux servers like Ubuntu, customer set the following parameter to NO to disable direct root login.

PermitRootLogin no

 

But, sometimes, you need to have root permissions to read or access certain files. This can create problems and lead to error “rysnc permission denied root” in Rsync

In such cases, our Support Engineers create a rsyncuser and add it to the /etc/sudoers file.  So that, the user can execute the rsync command without password.

rsyncuser ALL= NOPASSWD:/usr/bin/rsync

 

Then, we use rsync-path to make rsync works with the sudo.

rsync -a -e "ssh" --rsync-path="sudo rsync" rsync user@remoteserver:/data/to be/synced /destination/

 

2) Rsync configuration problems

Similarly, another common complaint raised by the customers is that they get permission denied errors when trying to use the rsync utility on the server. This involves rsync over SSH or rsync using a user with restricted access. We’ve seen instances where customers fail to add users in the run time configuration file rsyncd.config of rsync daemon.

Likewise, disabled rsync service on the remote server or using wrong SSH port on the remote server can also create problems.

Firstly, our Support Experts ensure that the root user is added in the file /etc/rsyncd.conf.

auth users = backup, root

 

In addition to that, we ensure correct password of the user is added in the file /etc/rsyncd.secrets.

backup:backuppassword
root:rootpassword

 

Further, we ensure that the file /etc/rsyncd.secrets has 600 permissions and ownership should be root. Moreover, we also make sure that the rsync service is enabled on the target server and customer uses correct port in their rsync command. If any issues noted, we’ll correct it immediately.

Similarly, our Support Experts also correct the syntax errors in rsync command.

 

3) Insufficient permissions for the user

Similarly, misconfigured permissions of the user can also create problems.

We’ve seen instances where the users linked to rysnc daemon are not correctly linked to the system users of the same name. In such cases, our Support Engineers set appropriate UserID and GroupID that the rsync daemon should use when accessing the files.

Similarly, most of the server owners now use SSH access key to improve system security. Server owners generate public key at origin server and copy it to the destination server. This ensures a smooth flow of data transfer. However, insufficient permission of the key files can create problems. Here, our Dedicated Engineers make sure that the key files have proper permissions. Most importantly, we ensure that .ssh folder have 700 and authorized_keys have 600 permissions.

Alternatively, in some cases, we use rsync command after disabling StrictHostKeyChecking in the file /.ssh/config.

Host *
StrictHostKeyChecking no

 

This will turn off host key checking in all hosts.

4) Issues at remote end

Similarly, non existence of the target path or insufficient permissions of the target folder can also lead to this error rsync permission denied for root.

In such cases, our Support Engineers get the rsync command used by the customer and check whether target location exists or not. Moreover, we ask the customers to check the permissions of this target folder so that files can be smoothly transferred from the original source.

 

Conclusion

In short, rsync permission denied for root can occur due to different reasons like permission issues, rsync configuration problems and so on. Today, we’ve discussed the top 4 reasons for this error and how our Dedicated Engineers fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF