Sample Header Ad - 728x90

mount with cifs: parameter to replace uid and gid by their names instead

0 votes
1 answer
2300 views
About Samba in Ubuntu, if in the server exists an user created for example with the omicron name with uid=1003 gid=1003 and executed: * sudo smbpasswd -a omicron Then, if in the client is tried (multiple lines for presentation purposes): sudo mount -t cifs //192.168.1.X/thenumbers /mnt/192.168.1.X/numbers -o username=omicron,rw I am able to mount the expected remote directory into the client, but is **not** possible write something, for example mkdir 777 - it appears _mkdir: cannot create directory '777': Permission denied_. According with man mount.cifs indicates: * rw mount read-write. **Question 1** Why the rw parameter didn't work as expected? If the directory is unmounted and again if in the client is tried (multiple lines for presentation purposes): sudo mount -t cifs //192.168.1.X/thenumbers /mnt/192.168.1.X/numbers -o username=omicron,uid=####,gid=#### Where: * rw does not appear anymore * uid **must** be the same than the server side, in this scenario omicron's uid 1003 * gid is optional, but should be the same than the server side, in this scenario omicron's gid 1003 I am able to mount the expected remote directory into the client and finally is possible write something, for example mkdir 777 **Question 2** Why did uid worked over rw? **Question 3** Is there some parameter to avoid use uid and use the user's name instead? I mean sudo mount -t cifs //192.168.1.X/thenumbers /mnt/192.168.1.X/numbers -o username=omicron,P1=omicron,P2=omicron I read the man mount.cifs but I couldn't find something that represents P1 and P2 to be replaced and applied in the command shown above.
Asked by Manuel Jordan (2108 rep)
Nov 4, 2021, 12:10 AM
Last activity: May 5, 2025, 09:01 PM