I've got a QNAP TS-110 which I access via NFS from my Ubuntu system.
I guess that NFS on a typical home network does not use any user authentication.
I've read in various places and I found that it is important that the user on the Linux machine and the NAS have same UID and/or GID.
- Now my main user on Ubuntu has
uid=1000(me) gid=1000(me)
. - On the NAS the main user has
uid=500 gid=100
I figure that this is the reason that I repeatedly run into access problems. (Is that so?)
My plan was to SSH into the NAS and use
usermod -u <newuid> -g<newgid> <username>
The problem is on the NAS there is no usermod
installed.
On it.toolbox.com I've read that I could simply edit /etc/passwd
and /etc/group
with the wanted UID and GID.
In the Fedora forum is lots of discussion on how to fix the files afterwards.
My questions now are:
- Can I simply edit
/etc/passwd
and group? - How can I check that no user I want to change the UID is not logged in?
- Is it correct to use
chown -R --from=500:500 1000:1000 /path/*
on all files once the config files are changed? - How can I make sure the NAS has no problem with this change?
Best Answer
I did it! (and it seems to work)
So after I had no reply at all (on all sites I've posted this question) I went ahead and did what I planned.
I've logged in my NAS via ssh as admin.
Next step was to modify the follwing two files so that all users created by me have a UID and GID starting with 1000
chagned into
next step was to chown and chgrp all files on the NAS. As the find that was available would not perform the exec command I did go through the dirs myself
I could fix all files and folder at once as there was only one main user that had uploaded files to the NAS.
Next I did restart my NAS and checked logging in as the users that I just changed.
I know this might not me the most elegant, fastest or right way of doing this but it worked for me and I hope this helps someone else.
Check here as well.