Set file owner, group, permissions

I’m using insync-headless to sync with two different GA accounts. I initially ran it as root (maybe a mistake), but there’s no specific user that works any better. I also want to run it as a daemon on system startup, so root seems to make sense. However, that means that all incoming files end up belonging to root with only read access for group members (I’d like rwX).

First question: Can I set up insync to assign a default user, group, or permissions for incoming files?

Second question: Can that be different for each account?

Third question: If I continue to run insync as root and I change the owner / group / permissions of files on the local disk, will that cause any problems as changes and new files sync back and forth?

2 Likes

Let me tag our engineer @lpugoy and he will get back to you :slight_smile:

@Bill_Kuhns1: Insync uses the umask, user id, and group id of the account running it when creating files. The user id and group id cannot be changed, but the umask can be set before running Insync so that created files will have the specified umask. It can’t be set per account though, because the umask, user id, and group id values are set for the whole program.

I don’t see an issue with changing the owner and permission values for the files in the Insync folder since you’re running Insync as root, so it can access them regardless. However if they are updated by Insync the owner and permission values will probably be overwritten, which could make them inaccessible to the other users in your system.

Thanks. I’ll try it and see. At least the insync process (as root) should be able to write whatever it needs to.

Hi there!

I’m replying to this post since I personaly think it’s the right place to ask my question (I hope i’m not mistaken, if yes, sorry…)

A few hours ago, I tested (and bought, thanks!!!) insync. Everything went fine, I solved all my issues reading and learning from the Internet (I’m not an advanced user with Linux… Thanks google!). But one issue got me pinned.

I’m using a Debian machine as a storage server, among other things. Yes, I’m using root for almost everything, from SSH access to network sharing. I can read/write file on my shared drive just fine from my Windows machine (Windows use my root credentials to map the drive), except for what insync downloaded from Google Drive. Everything in the insync designated folder is read only from my Windows computer, even if the folders/files permissions are showing as owned by “root”; the same permissions are shown on everything outside that folder.

I tested a few things, and to be able to write in the designated insync folder I have to give “others” write access. By “others” I mean the “third” part of the permissions… I was shown by a coworker the use of “chmod”, with 3 numbers, the first beeing the “owner”, the second beeing the “group”, and the third beeing “others”. If I use “chmod -R 766” on the folder, the issue is solved…

The question is: Why don’t it work with “744” permissions, just like every other files?

I’m so sorry if my explanations aren’t clear, I may be a noob with that kind of talk :frowning:

Please help?

Have a great whatever_time_is where you are living,

Bodo

Hi Bodo,

You have come to the right place. :slight_smile:

Will be tagging our engineer @jimperio for assistance.

1 Like

Hello there!

Any news about this one?

See you!

Hi @BodoQC

“744” permissions don’t work because it only gives read access to the “group” and “others” but you also need write permissions on those files which “766” gives. The 6 in “766” is -> 4 (Read) + 2 (Write) = 6
I hope I answered your question. Let me know if you need further clarification!

Thanks!

3 Likes

Hi @Kurt_Ko !

A huge thanks to you for that answer! I just went through verifying everything with that new thing in mind, and I also a changed the ownership of the insync folder to my Windows user instead of the root one I used to map the drive… Everything went well after that !

I knew the trouble was on my side, thanks again for the help!

Have a great day!

2 Likes