LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Mounting cifs with read/write permissions for a non-root user (http://www.linuxquestions.org/questions/linux-networking-3/mounting-cifs-with-read-write-permissions-for-a-non-root-user-738988/)

icmp_request 07-09-2009 03:07 PM

Mounting cifs with read/write permissions for a non-root user
 
Hello guys! First, I've posted it on "Linux - Newbie" Forum but as I've later figured out that it's not a so "newbie" question I've asked for the forum admins to lock that thread and continue on this one, which seems to be the proper forum to post this problem:

I wish to mount a cifs folder and I wish to give the user id 1701 read AND write permission. I've already tried adding "user" on fstab but when I try to mount the mount command cannot be run by a user. I tried as root anyway and gave the following command:

mount -t cifs //192.168.0.2/Share /mnt/share/ -o iocharset=utf8,uid=1701,gid=1701,rw

The problem is, it only mounts the folder with r-x permissions so I don't have +w on any of its files. See below:

root@voyager:/mnt# ls -n
total 8
drwxr-xr-x 2 0 0 4096 2009-07-08 19:14 cifs-1
drwxr-xr-x 2 0 0 4096 2009-07-08 19:14 cifs-2
dr-xr-xr-x 1 1701 1701 0 2009-07-08 18:52 share

I've already tried chmod the folder to 1777 but no success... any ideas? :/

titetanium 07-09-2009 09:39 PM

HI,

Have you tried using umask=000 or users in the mount command?

icmp_request 07-11-2009 08:58 PM

Yes I've tried:

root@voyager:/# mount -t cifs //192.168.0.2/Share /mnt/home-share/ -o iocharset=utf8,uid=1701,gid=1701,rw,users,umask=000

root@voyager:/# ls -n /mnt
total 8
drwxr-xr-x 2 0 0 4096 2009-07-08 19:14 cifs-1
drwxr-xr-x 2 0 0 4096 2009-07-08 19:14 cifs-2
dr-xr-xr-x 1 1701 1701 0 2009-07-11 19:13 home-share

RichardUK 12-13-2009 02:30 PM

Hi, I have the same issue. I want to mount the folder for my mail client so that if my system goes pop my mail is safe on the server. As it's for the mail client it needs read write access. If I browse to the samba share I have the correct access rights. But when I mount it as a folder no joy, read only. :o(

Come back smbfs, all is for given.........

paratrooper 07-04-2012 06:59 AM

For me, it worked with parameter uid=%username%.

rksii 01-28-2014 12:33 PM

Just found this solution on an OpenSUSE board and it worked for me:

Code:

//yourserver/share /mnt/share cifs username=username,password=password,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0


All times are GMT -5. The time now is 02:31 AM.