# SMB mounts.. permission denials...

## mody

hi, been trying to mount a windows share via smb on my gentoo system.

Have been sucessful up to getting it to mount after which I cant acess the mount,

I have been given read write on the share as I can through Konqueror view and modify the folder.

```
mody ~ # mount -t smbfs -o ip=172.16.2.222,username=applabs\\050436,iocharset=utf-8,codepage=utf-8,rw,uid=0,gid=0 //altvss02/VSS /mnt/e-Security_VSS/

opts: rw

opts: ip=172.16.2.222

opts: username=applabs\050436

opts: iocharset=utf-8

opts: codepage=utf-8

opts: uid=0

opts: gid=0

passthrough options 'iocharset=utf-8,codepage=utf-8'

mount.smbfs started (version 3.0.14a)

added interface ip=172.16.6.137 bcast=172.16.15.255 nmask=255.255.240.0

Connecting to 172.16.2.222 at port 445

Password:

```

```

mody ~ # mount -v

/dev/hda6 on / type reiserfs (rw,noatime)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

udev on /dev type tmpfs (rw,nosuid)

devpts on /dev/pts type devpts (rw)

/dev/hda3 on /boot type reiserfs (rw,noatime)

/dev/hda7 on /home type reiserfs (rw,noatime)

shm on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)

usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85)

//altvss02/VSS on /mnt/e-Security_VSS type smbfs (0)

```

```

mody ~ # ls /mnt/e-Security_VSS

ls: /mnt/e-Security_VSS: Permission denied

```

Is there some work around this issue.

----------

## MEW

I think that your problem is that you're setting it to be owned by root, then trying to access it as a user. Try either changing uid and/or gid (in the options) or use the umask option.

----------

## mody

I've tried everything with/without those switched, tried to access as root, users everything... cant seem to get it to work at this point, not sure what I'm missing.

----------

## mody

I CAN even access the files using 'smbclient', what is it thats wrong with my mount call??? anybody? help?

----------

## MEW

Could it be the permissions of the mountpoint? Can you access that folder when it doesn't have anything mounted on it?

----------

## mody

MEW

 *Quote:*   

> Could it be the permissions of the mountpoint? Can you access that folder when it doesn't have anything mounted on it?

 

Yes I have full access to the mount folder, also thruough smbclient I could modify the folder too!

----------

## MEW

I mean the mountpoint on the computer that's trying to connect (/mnt/e-Security_VSS)

----------

## mody

I did an 'mkdir /mnt/...' so I do have permissions on that folder as root. Funny thing is after its mounted the smb share I cant even see the folder with an 'ls /mnt'. After a umount on the folder its visible and accessable again.

----------

## eunuque

You may try to use cifs instead of smbfs as filesystem type.

In my case it solved everything!

----------

## Gentree

 *mody wrote:*   

> I did an 'mkdir /mnt/...' so I do have permissions on that folder as root. Funny thing is after its mounted the smb share I cant even see the folder with an 'ls /mnt'. After a umount on the folder its visible and accessable again.

 

Note that permissions on the mounted directory can be changed by mount.

In /etc/fstab:

```

//linbox/photos    /smb/photos        smbfs  noauto,username=prof,ro,users 0 0

```

```
prof@linbox /tmp $ whoami

prof

prof@linbox /tmp $ ls -ail /smb/photos

total 1

1498654 drwxrwxrwx  2 prof users 2 Jan  7 17:37 .

1498652 drwxr-xr-x  5 root root  5 Jan  7 17:37 ..

prof@linbox /tmp $ mount /smb/photos

Password: 

prof@linbox /tmp $ ls -ail /smb/photos

total 5

      2 drwxr-xr-x  1 prof users 4096 Jan 10 23:31 .

1498652 drwxr-xr-x  5 root root     5 Jan  7 17:37 ..

prof@linbox /tmp $ umount !$

```

And the mount point becomes owned by the mounter :

```
prof@linbox /var/log/samba $ mount /photos

prof@linbox /var/log/samba $ ls -ail !$

ls -ail /photos

total 44

   1 drwxrwxrwx   4 prof users 8192 Jan  1  1970 .

  42 drwxr-xr-x  62 root root    63 Jan  7 17:37 ..

9127 drwxrwxrwx  11 prof users 8192 Dec 20  2004 Photos

9129 -rwxrwxrwx   1 prof users  261 Aug 11 15:55 Raccourci vers Photos.lnk

9128 drwxrwxrwx   3 prof users 8192 Dec 20  2004 System Volume Information

9126 -rwxrwxrwx   1 prof users 1309 Oct 24  2003 uninst.log

prof@linbox /var/log/samba $ umount !$

umount /photos

prof@linbox /var/log/samba $ exit

exit

bash-3.00#mount /photos

bash-3.00#ls -ail !$

ls -ail /photos

total 44

   1 drwxrwxrwx   4 root root 8192 Jan  1  1970 .

  42 drwxr-xr-x  62 root root   63 Jan  7 17:37 ..

9135 drwxrwxrwx  11 root root 8192 Dec 20  2004 Photos

9137 -rwxrwxrwx   1 root root  261 Aug 11 15:55 Raccourci vers Photos.lnk

9136 drwxrwxrwx   3 root root 8192 Dec 20  2004 System Volume Information

9134 -rwxrwxrwx   1 root root 1309 Oct 24  2003 uninst.log

```

Also how is your [share] defined in smb.conf , does it have Browsable = Yes  ?

Could the backslash in the username be causing and issue?

Hope that helps you see where it sticking.

For more specific help I think you'll need to post more specific information , you're leaving us guessing your config.

 :Cool: 

----------

## tuxman

I have the exact same problem.. thing is.. it used to work.. I have 2 existing box's..and a new box.. 

one of the existing box's is a redhat 7.2 box (i know old..) .. it works.. I can unmount and remount.. using smbfs.. and can access fine (Samba 2.2.1a)

My other box is a gentoo box with samba 3.0.20b which DID work.. and now for some reason has stopped working.  mount command issues fine.. but get a permission denied when I try to ls 

[root@mail2 ftp]$ls -la

total 24

drwxr-xr-x   6 root root 4096 Oct 16  2004 .

drwxr-xr-x  19 root root 4096 Mar  4 11:56 ..

drwxr-xr-x   2 root root 4096 Oct 16  2004 appsx

drwxr-xr-x   2 root root 4096 Oct 16  2004 ftpdir

drwxr-xr-x   2 root root 4096 Oct 16  2004 storage

[root@mail2 ftp]$mount -t smbfs -o username=XXXXXXXX,password=XXXXXXXX,fmask=7666 //snafu-2003/storage /home/ftp/storage

[root@mail2 ftp]$mount

/dev/sda3 on / type ext3 (rw,noatime)

none on /dev type devfs (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw)

/dev/sda4 on /var type ext3 (rw,noatime)

/dev/sdb1 on /home type ext3 (rw,noatime)

none on /dev/shm type tmpfs (rw)

usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85)

/dev/sda1 on /boot type ext3 (rw,noatime)

//snafu-2003/storage on /home/ftp/storage type smbfs (0)

[root@mail2 ftp]$ls -la storage

ls: storage: Permission denied

[root@mail2 ftp]$ls -la

ls: storage: Permission denied

total 20

drwxr-xr-x   6 root root 4096 Oct 16  2004 .

drwxr-xr-x  19 root root 4096 Mar  4 11:56 ..

drwxr-xr-x   2 root root 4096 Oct 16  2004 appsx

drwxr-xr-x   2 root root 4096 Oct 16  2004 ftpdir

[root@mail2 ftp]$

and I have a new box with samba 3.0.23.

I'd almost say something broke on a windows update because I haven't ran an emerege world update on the gentoo box for a long time, but then why is the redhat box still working.  

I'm stumped at this point.. if anyone can point me in the right direction I'd really appreciate it.

Dave

----------

## Gentree

I cant tell you what's wrong but here's some ideas:

several versions of samba still in portage , try an older one to compare.

```
bash-3.1#etcat -v samba

[ Results for search key           : samba ]

[ Candidate applications found : 8 ]

 Only printing found installed programs.

*  net-fs/samba :

        [   ] 3.0.14a-r2 (0)

        [ ~ ] 3.0.20b (0)

        [ ~ ] 3.0.21a (0)

        [ ~ ] 3.0.21b-r1 (0)

        [   ] 3.0.22 (0)

        [ ~I] 3.0.22-r2 (0)

        [   ] 3.0.22-r3 (0)

        [ ~ ] 3.0.23 (0)

```

su to your user and ls -ail storage

remount as root rather than user, ls -ail 

run chmod and chown of storage to see if you can get some more sense out of it.

go to samba doc and checkout the change log.

why 7666 ? You will need x perms to list a dir.

 :Cool: 

PS

```

#ubuntu guide http://www.ubuntuguide.org/#mountunmountntfs

#//192.168.0.1/linux        /media/sharename  smbfs   credentials=/root/.smbcredentials,dmask=777,fmask=777   0       0

```

----------

