Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rclone config file changing file permission #1742

Closed
ColeMundus opened this issue Oct 14, 2017 · 14 comments
Closed

rclone config file changing file permission #1742

ColeMundus opened this issue Oct 14, 2017 · 14 comments

Comments

@ColeMundus
Copy link

ColeMundus commented Oct 14, 2017

I have observed this issues in rclone version v1.37

So I'm having issues with rclone randomly changing file permissions. Every few minutes, the file permissions change to 0600/-rw-------. I have been experiencing this for several weeks. I have checked all my crontabs and don't use rclone with any scripts. I tried moving my config file from ~/.rclone.conf to ~/.config/rclone/rclone.conf and it is still doing it. I have experienced this on other machines also.

@ncw
Copy link
Member

ncw commented Oct 15, 2017

rclone sets the permissions to 0600 when it saves things in the config file (which it will do when tokens are refreshed).

The config file contains confidential stuff like access tokens so should be user readable only.

@ColeMundus
Copy link
Author

Is there any way to disable this behavior?

@ncw
Copy link
Member

ncw commented Oct 17, 2017

Is there any way to disable this behavior?

Not currently - why do you want to?

@ncw
Copy link
Member

ncw commented Dec 12, 2017

Perhaps the best thing would be if rclone only set the permissions on the config file when writing it for the first time.

@ncw ncw added this to the Help Wanted milestone Aug 30, 2018
@Corxo
Copy link

Corxo commented Nov 16, 2018

Hello,
I know this is an old thread but I just found out the same problem, every day I found the rclone config file owned by the root user and I can't access it by with other users. I run a daily scheduled backup using rclone as sudo in crontab (I edit crontab as root, I don't run sudo rclone ...) could this be the problem?

@ncw
Copy link
Member

ncw commented Nov 19, 2018

Hello,
I know this is an old thread but I just found out the same problem, every day I found the rclone config file owned by the root user and I can't access it by with other users. I run a daily scheduled backup using rclone as sudo in crontab (I edit crontab as root, I don't run sudo rclone ...) could this be the problem?

Yes using rclone with sudo will leave the config file root owned. You could use a seperate config with the sudo use with --config?

@marco-m
Copy link
Contributor

marco-m commented Nov 16, 2019

In my opinion the current rclone behavior is correct, for the security reasons explained by @ncw, I don't see the reason to change, even as an option.
@ncw: what would you expect as implementation to satisfy this issue?
@ColeMundus: what is the rationale behind this request?

@SuperSandro2000
Copy link

@marco-m It not only changes the permission but also the owner to the current user. Annoying when you share one rclone config with a system backup script.

@ncw
Copy link
Member

ncw commented Nov 16, 2019

When rclone re-writes the config file it writes the new config as a new file then renames the old one out of the way and renames the new one in to place.

Rclone could copy the permissions from the old config file when writing the new one.

Copying the ownership is possible to but that isn't easy to do in a cross platform way.

@SuperSandro2000
Copy link

Maybe it would keep the permission if you rename the old file and copy it in place.

@ncw
Copy link
Member

ncw commented Nov 16, 2019

Rclone uses the procedure it does so that if the disk gets full while writing the config file it doesn't corrupt it (which is a real problem reported by users!).

@SuperSandro2000
Copy link

I mean if it copies the old file instead of creating a new one it should keep the permissions.

@userwiths
Copy link

Hey, just a quick heads-up.
I was looking into picking this issue up and found out that it should already be resolved thanks to those changes from 2021.
Proceeded to pull the repo and test it locally (Linux Arch 6.7.2) and yes, now the file is saved with its previous/unchanged permissions after doing edits with the rclone config command.

@ncw
Copy link
Member

ncw commented Feb 17, 2024

@userwiths thanks for testing that and writing it up. I'll close this issue :-)

@ncw ncw closed this as completed Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants