Ubuntu: uid/gid option required to gain write access to remote share

I have Synology NAS, and I share the “home” directory as a CIFS share.

From Windows, I simply do net use N: \\home\nas /user:myuser *, and it works.

Corresponding command from Ubuntu is

sudo mount -t cifs //nas/home /mnt/nas -o username=myuser

It works, but the mount is effectively read-only: I am unable to make any modification to remote files or create new files/directories. The effect is the same even if I add “rw” option.

I used ChatGPT to ask what to do in this case, and it advised to add “uid” and “gid” parameters. Apparently, remote files are considered to be owned by ‘root’, and my users is not allowed to make changes. The following command works:

sudo mount -t cifs //nas/home /mnt/nas -o username=ikriv,rw,uid=1000,gid=1000

Here “1000” is ID of the user root. I suppose “rw” is redundant, but it does not harm.

Leave a Reply

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