Score:2

change permission of mounted folder in linux

cn flag

i mounted a folder from windows to Linux's like so

in windows end the permission is set to everyone enter image description here

and on my linux end i did this

# mount -t cifs -o username=sprite//173.11.111.99/win-share /mnt
Password for sprite@//173.11.111.99/win-share:  ************
# ls -ld
drwxr-xr-x. 2 root root 0 Sep  2 15:27 .
#

i have another user named coke which i want to have read/write/execute permission to how can i go about doing this

Score:1
ie flag

You need to define the wanted user id and group id in the mount command. Add uid and gid-parameters to the options. You can look up your user's values with the id command.

Example set of parameters: uid=1000,gid=1000,username=sprite

Provided your user and group id were 1000.

For the another user to access, put the users in the same group, such as users, then use that group's id in the mount command's gid-parameter. In this case I believe you also need additional parameter for the group to be able to write on the share, in which case you need the additional parameters dir_mode=0770,file_mode=0770

kunz avatar
cn flag
`# mount -t cifs -o uid=1000,gid=1000,username=sprite//173.11.111.99/win-share /mnt` is it suppose to be like this ?
Ari 'APz' Sovijärvi avatar
ie flag
Looks about right, save the missing space between your username and the server path. I tested with following command: `mount -t cifs -o uid=1000,gid=100,dir_mode=0770,file_mode=0770,username=myusername //192.168.0.10/demo /mnt/demo`
Jarle Hammen Knudsen avatar
in flag
Why is both a uid and username parameter necessary?
Ari 'APz' Sovijärvi avatar
ie flag
@JarleHammenKnudsen uid and gid are used by Linux and that's the user ID and group given to all files on the Linux side. Username again is the user name offered to the other computer as a login credential.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.