Mount cifs - no read/write access for non-root user

Hello!
I have FreeNAS server and domain-controller with Windows Server 2008. I use OpenSuse 11.4 and my Windows account have full access to FreeNAS CIFS share. I can connect through any filemanager with smb protocol support using

smb://windows_user@freenas/share

and I can read and write to any folder.

Now I’m trying to setup mount.cifs. Here is my string in /etc/fstab:

//freenas/share /mnt/Data cifs username=windows_user,password=windows_password,_netdev,uid=1000,gid=100 0 0

(where 1000 is my default linux user ID and 100 is ‘users’ group ID).

After mount -a I see folders from FreeNAS share but I can read/write them only as root user (not default user with ID = 1000).

Also ls -o says that folder’s owner is 1000 but no read/write access for him.

I tried options like ‘file/dir_mode=0777’ or ‘forceuid/gid’ or add user 1000 to root group - none of this worked.
Any ideas what’s wrong?

  1. for SAMBA read: openSUSE SuSE Linux HOWTOs and Tutorials by Swerdna (first item in the table).

hcvv, I used page from your link to setup my fstab. I also tried to move username/password to ‘credentials’ option, still no access for user id 1000. And I get the same situation if i mount this share using autofs.

I am not a SAMBA user at all. And Swerdna himself is off for a holliday of a few days.

But people having problems in using mounted exports (I think the word “share” is used in Windows terms), often have the ownership/access of the mountpoint wrong. Thus show us

ls -ld /mnt/Data
ink@localhost:~> ls -ld /mnt/Data
drwxrwxrwx 10 ink users 0 Jul 25 11:22 /mnt/Data

OK, that is fine. Thus this very often occurring error is not made in this case.
As said I am not a SAMBA user, thus I have no experience with the owning user/group and access bits faking that such a mount does. So againn something wild (I guess you checked that of course, but you did not show and and I am curious), what were they made in your case?

ls -la /mnt/Data

(BTW why do you have a directory that is strictly for user ink inside a place where the system manager is supposed to be free to handle all sorts of mounts needed for system managent? Why is this not somewhere inside that users home directory?)

I think that’s because there is only one user and no really need to make it well-secured or structured. Maybe I should mount it to home directory =)
Now, listenings:

ink@localhost:~> ls -la /mnt/Data
total 4
drwxrwxrwx 10 ink  users    0 Jul 25 11:22 .
drwxr-xr-x  4 root root  4096 Aug  2 15:16 ..
drwxr-xr-x  2 ink  users    0 Jul 23 18:22 .AppleDB
d---------  7 ink  users    0 Jul 28 11:04 Distr
d---------  3 ink  users    0 Jul 23 13:02 Docs
d---------  5 ink  users    0 Jul 23 12:02 Exchange
drwxr-xr-x  3 ink  users    0 Апр 16 20:15 Network Trash Folder
d---------  8 ink  users    0 Jul 23 13:03 Project
d--------- 14 ink  users    0 Aug  1 14:39 Support
drwxrwxrwt  4 ink  users    0 Июн 25 11:23 .Trashes
ink@localhost:~> cd /mnt/Data/Exchange/
bash: cd: /mnt/Data/Exchange/: Access denied

ink@localhost:~> su
Password: 
localhost:/home/ink # ls -la /mnt/Data
total 4
drwxrwxrwx 10 ink  users    0 Jul 25 11:22 .
drwxr-xr-x  4 root root  4096 Aug  2 15:16 ..
drwxr-xr-x  2 ink  users    0 Jul 23 18:22 .AppleDB
d---------  7 ink  users    0 Jun 28 11:04 Distr
d---------  3 ink  users    0 Jul 23 13:02 Docs
d---------  5 ink  users    0 Jul 23 12:02 Exchange
drwxr-xr-x  3 ink  users    0 Apr 16 20:15 Network Trash Folder
d---------  8 ink  users    0 Jul 23 13:03 Project
d--------- 14 ink  users    0 Aug  1 14:39 Support
drwxrwxrwt  4 ink  users    0 Jun 25 11:23 .Trashes
localhost:/home/ink # cd /mnt/Data/Exchange/
localhost:/mnt/Data/Exchange # ls
.AppleDouble  FTP  SHARE

On Thu, 02 Aug 2012 12:06:03 GMT, k1berpunk
<k1berpunk@no-mx.forums.opensuse.org> wrote:

>
>hcvv, I used ‘page’
>(http://www.swerdna.net.au/susesambacifs.html#permown) from your link to
>setup my fstab. I also tried to move username/password to ‘credentials’
>option, still no access for user id 1000. And I get the same situation
>if i mount this share using autofs.

Having a dollop of experience here i suspect your issue is on the server
side rather than on the client side. but that is only a guess.

?-)

emaz from Superuser dot com solved my problem (he had the same one).


//192.168.1.33/Public /mnt/nasPublic cifs       username=username,password=password,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

I tried all of this options before (excluding iocharset) but not at this combination, I think.
Anyway, this solved my problem. And may be helpful for someone else.

Thank you :slight_smile: