Mount SMB Share - Error 13 Permission denied.

Hello… I’m trying to mount my SMB share that’s on my openSUSE 11.1 server on my openSUSE 11.1 laptop.

The share is functioning fine if I access it via Dolphin using the following path:
smb://192.168.1.100/www

When I try to mount it (for the programs that don’t handle the SMB protocol)
mount -t cifs -o guest //192.168.1.100/www /home/Pascal/Shared/www
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

So I went to mount.cifs(8) - Linux man page but it didn’t tell me much.

The server is configured like this (/etc/samba/smb.conf):

[www]
    comment = Webserver
    guest ok = Yes
    inherit acls = Yes
    path = /srv/www/htdocs/
    read only = No
    force user = nobody
    guest only = Yes

On Mon December 22 2008 08:56 am, Axeia wrote:

>
> Hello… I’m trying to mount my SMB share that’s on my openSUSE 11.1
> server on my openSUSE 11.1 laptop.
>
> The share is functioning fine if I access it via Dolphin using the
> following path:
> SMB://192.168.1.100/WWW
> When I try to mount it (-for the programs that don’t handle the SMB
> protocol-)
> mount -t cifs -o guest //192.168.1.100/www /home/Pascal/Shared/www
> mount error 13 = Permission denied
> Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

> So I went to ‘mount.cifs(8) - Linux man page’
> (http://linux.die.net/man/8/mount.cifs) but it didn’t tell me much.
>
> The server is configured like this (/etc/samba/smb.conf):
> Code:
> --------------------
> [www]
> comment = Webserver
> guest ok = Yes
> inherit acls = Yes
> path = /srv/www/htdocs/
> read only = No
> force user = nobody
> guest only = Yes
> --------------------
>
>
Try moving the -o options after the service and mount point, also try adding
to the options “domain = <your workgroup/domain>”

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On Mon December 22 2008 01:22 pm, PV wrote:

> On Mon December 22 2008 08:56 am, Axeia wrote:
>
>>
>> Hello… I’m trying to mount my SMB share that’s on my openSUSE 11.1
>> server on my openSUSE 11.1 laptop.
>>
>> The share is functioning fine if I access it via Dolphin using the
>> following path:
>> SMB://192.168.1.100/WWW
>> When I try to mount it (-for the programs that don’t handle the SMB
>> protocol-)
>> mount -t cifs -o guest //192.168.1.100/www /home/Pascal/Shared/www
>> mount error 13 = Permission denied
>> Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

>> So I went to ‘mount.cifs(8) - Linux man page’
>> (http://linux.die.net/man/8/mount.cifs) but it didn’t tell me much.
>>
>> The server is configured like this (/etc/samba/smb.conf):
>> Code:
>> --------------------
>> [www]
>> comment = Webserver
>> guest ok = Yes
>> inherit acls = Yes
>> path = /srv/www/htdocs/
>> read only = No
>> force user = nobody
>> guest only = Yes
>> --------------------
Axeia;

After thinking about this, I don’t think my earlier post will help much. Won’t
harm, but not likely to solve this. So:

  1. In the global section of your /etc/samba/smb.conf, have you set the
    parameter “map to guest = Bad User”? If not do this.

  2. In your share [www], you may not want “guest only = yes”. With the
    parameter, force user = nobody, everyone who connects will become user
    nobody; it acts a bit like “su nobody”. I suggest you take out “guest only”

  3. I’m not sure just how the “guest” option in the mount tries to
    authenticate, I would suggest you check this out as follows. To the global
    section of your smb.conf add this parameter “log level = 1 auth:3”. You can
    then read the authentication transaction in /var/log/samba/log.smbd ( if you
    changed the log file in your smb.conf it will be in that file.) Be sure to
    remove this when you are done testing.

  4. Be sure to restart smbd after editing your smb.conf.


su
rcsmb restart

  1. In your mount.cifs command use the option “user=<username>”. If <username>
    is a valid Samba user, you will authenticate as <username>, then be mapped to
    nobody on the share(see 2 above). If <username> is NOT a valid Samba user,
    then you should authenticate as guest (see 1 above)

You might want to look here as well:
http://www.swerdna.net.au/linhowtosambacifs.html


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Seems like YaST samba-server set this up for me correctly :slight_smile:

All gone

What exactly am I looking for? Got

[2008/12/22 23:32:04,  1] smbd/service.c:close_cnum(1401)
  pascal-laptop (192.168.1.36) closed connection to service www
[2008/12/22 23:32:04,  0] smbd/server.c:main(1209)
  smbd version 3.2.4-5.2-1985-SUSE-CODE11 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2008
[2008/12/22 23:32:06,  3] auth/auth.c:check_ntlm_password(220)
  check_ntlm_password:  Checking password for unmapped user [Pascal-Laptop]\[Pascal]@[PASCAL-LAPTOP] with the new password interface
[2008/12/22 23:32:06,  3] auth/auth.c:check_ntlm_password(223)
  check_ntlm_password:  mapped user is: [BAKHUIS]\[Pascal]@[PASCAL-LAPTOP]
[2008/12/22 23:32:06,  3] auth/auth_sam.c:check_sam_security(282)
  check_sam_security: Couldn't find user 'Pascal' in passdb.
[2008/12/22 23:32:06,  3] auth/auth_winbind.c:check_winbind_security(54)
  check_winbind_security: Not using winbind, requested domain [BAKHUIS] was for this SAM.
[2008/12/22 23:32:06,  2] auth/auth.c:check_ntlm_password(318)
  check_ntlm_password:  Authentication for user [Pascal] -> [Pascal] FAILED with error NT_STATUS_NO_SUCH_USER
[2008/12/22 23:32:06,  1] smbd/service.c:make_connection_snum(1190)
  pascal-laptop (192.168.1.36) connect to service www initially as user nobody (uid=65534, gid=65533) (pid 9028)
[2008/12/22 23:33:06,  3] auth/auth.c:check_ntlm_password(220)
  check_ntlm_password:  Checking password for unmapped user ]\]@[PASCAL-LAPTOP] with the new password interface
[2008/12/22 23:33:06,  3] auth/auth.c:check_ntlm_password(223)
  check_ntlm_password:  mapped user is: [BAKHUIS]\]@[PASCAL-LAPTOP]
[2008/12/22 23:33:06,  3] auth/auth.c:check_ntlm_password(269)
  check_ntlm_password: guest authentication for user ] succeeded

Edit:
This from accessing the share from a windows PC btw, but as it’s a ‘guest’ as well I guess it gets treated all the same.

On Mon December 22 2008 04:46 pm, Axeia wrote:

>
> PV;1913683 Wrote:
<snip
> What exactly am I looking for? Got
>
> Code:
> --------------------
> [2008/12/22 23:32:04, 1] smbd/service.c:close_cnum(1401)
> pascal-laptop (192.168.1.36) closed connection to service www
> [2008/12/22 23:32:04, 0] smbd/server.c:main(1209)
> smbd version 3.2.4-5.2-1985-SUSE-CODE11 started.
> Copyright Andrew Tridgell and the Samba Team 1992-2008
> [2008/12/22 23:32:06, 3] auth/auth.c:check_ntlm_password(220)
> check_ntlm_password: Checking password for unmapped user
> [Pascal-Laptop][Pascal]@[PASCAL-LAPTOP] with the new password interface
> [2008/12/22 23:32:06, 3] auth/auth.c:check_ntlm_password(223)
> check_ntlm_password: mapped user is: [BAKHUIS][Pascal]@[PASCAL-LAPTOP]
> [2008/12/22 23:32:06, 3] auth/auth_sam.c:check_sam_security(282)
> check_sam_security: Couldn’t find user ‘Pascal’ in passdb.
> [2008/12/22 23:32:06, 3] auth/auth_winbind.c:check_winbind_security(54)
> check_winbind_security: Not using winbind, requested domain [BAKHUIS] was
> for this SAM.
> [2008/12/22 23:32:06, 2] auth/auth.c:check_ntlm_password(318)
> check_ntlm_password: Authentication for user [Pascal] → [Pascal] FAILED
> with error NT_STATUS_NO_SUCH_USER
> [2008/12/22 23:32:06, 1] smbd/service.c:make_connection_snum(1190)
> pascal-laptop (192.168.1.36) connect to service www initially as user
> nobody (uid=65534, gid=65533) (pid 9028)
> [2008/12/22 23:33:06, 3] auth/auth.c:check_ntlm_password(220)
> check_ntlm_password: Checking password for unmapped user
> ]]@[PASCAL-LAPTOP] with the new password interface
> [2008/12/22 23:33:06, 3] auth/auth.c:check_ntlm_password(223)
> check_ntlm_password: mapped user is: [BAKHUIS]]@[PASCAL-LAPTOP]
> [2008/12/22 23:33:06, 3] auth/auth.c:check_ntlm_password(269)
> check_ntlm_password: guest authentication for user ] succeeded
> --------------------
>
>
> Edit:
> This from accessing the share from a windows PC btw, but as it’s a
> ‘guest’ as well I guess it gets treated all the same.
>
Axeia;
But what happens with the mount.cifs command that fails? This appears to
succeed. Perhaps I misunderstood, but I thought you were trying to mount on
a Linux machine.

I assume Pascal (not a bad choice for your user name, but I was always partial
to Galois) is a user on both the Windows and Linux machine. Pascal was not
in the Samba password file and so this failed, (unless you specify something
different, Windows sends your local name and password.) Samba then allowed
you in as guest. Notice you connected to the share as “nobody”. If you
added the user Pascal, to the Samba password file with “smbpasswd -a Pascal”.
You should have authenticated as Pascal, and then connected as user nobody


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

You didn’t misunderstand, I am trying to mount it on a linux box… but it’s a dual boot and in order to get my work done I need access to the share in Eclipse (a program) which does not support the smb:// protocol and thus I’m forced to use windows for now as I can run Eclipse there with access to the share (windows ‘mounts’ it just fine after all).

I’ll reboot to openSUSE and see how far the mount command gets me now.

Got it solved :slight_smile:

Big Thanks for the logging tip it was invaluable in solving the problem. (reminds me… need to turn it off)
With the log next to me over a VNC session I could see see what was going on; it was submitting the username root instead of anonymous (dolphins smb:// default) or nobody (windows vista explorer default).

As to why it’s submitting root as the username… you need root rights to mount something so since you’re logging in as root while doing so it submits root as the username… and the -o guest doesn’t seem to prevent it, all it does is suppress the password prompt.

With that knowledge I did some logical late night thinking and thought about adding adding a bogus username (Well not so bogus, went for “Pascal” again ;)… sorry about that, I do prefer it over “Galois”).
So that left me with it asking for a password while not needing one (that’s why I tried -o guest in the first place). Not much of a problem though, it’s accepting a blank password and is working like I wanted it to.

So if anyone runs into a similar problem, modify the command below:

mount -t cifs -o username=Pascal,password= //192.168.1.100/www /home/Pascal/Shared/www