Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: CIFS Mount with Guest Account not Work

  1. #1
    Join Date
    Jan 2009
    Beans
    5

    Question CIFS Mount with Guest Account not Work

    My issue is that I cannot connect the Samba share drive with guest account. The command I used is

    sudo mount -t cifs -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77,noperm //mybookworld/data ~/test

    But the error I got is

    mount error 13 = Permission denied
    Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)


    I've also tested the connection with smbclient. Strange is that smbclient works fine. The command I used was:

    smbclient //mybookworld/data whateverpass -U whateveruser

    So my question here is that, what could possibly be the reason that the smbclient works but the mount.cifs does not?

  2. #2
    Join Date
    Jan 2009
    Beans
    5

    Re: CIFS Mount with Guest Account not Work

    Here is the info of the machine running the Samba. It is a Mybookworld box also running Linux, but not Ubuntu. The log info I got from it is that:

    [2009/03/25 06:33:09, 0] smbd/service.c:make_connection_snum(773)
    make_connection: connection to data denied due to security descriptor.


    I believe the Samba service running on it, like all the other services, were trimmed to fit its memory. And here is the excerpt of its smb.conf file:

    [global]
    server string=MyBookWorld
    workgroup=workgroup
    interfaces=192.168.1.117/24 127.0.0.1/8
    security=user
    smb passwd file=/var/private/smbpasswd
    private dir=/var/private
    guest account=www-data
    log file=/var/log/log.%m
    log level=1 auth:3
    max log size=50
    dns proxy=No
    lock directory=/var/locks
    pid directory=/var/locks
    use sendfile=Yes
    map to guest = Bad User
    create mask = 755
    map hidden = Yes
    veto files = /shares/internal/.senvidData/ /shares/internal/lost+found/

    [data]
    path = /dr01/data
    writeable = yes
    guest ok = yes
    browseable = yes
    create mask = 775
    directory mask = 775
    force create mode = 775
    force directory mode = 775
    force group = sambashare
    map hidden = No

  3. #3
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,362
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: CIFS Mount with Guest Account not Work

    The smb.conf file is strange. I've marked the problem points:
    Code:
    [global]
    server string=MyBookWorld
    workgroup=workgroup
    interfaces=192.168.1.117/24 127.0.0.1/8
    security=user
    smb passwd file=/var/private/smbpasswd
    private dir=/var/private
    guest account=www-data
    log file=/var/log/log.%m
    log level=1 auth:3
    max log size=50
    dns proxy=No
    lock directory=/var/locks
    pid directory=/var/locks
    use sendfile=Yes
    map to guest = Bad User
    So the share definition (not included in my excerpt above) indicates that guest is okay, but the global options indicate that guest is a bad user.

    You might have success by simply removing the "map to guest = Bad User" option from the worldbook smb.conf. I'm not sure why this was included and it doesn't make much sense given the rest of the smb.conf file.

    Or, try this:
    Code:
    sudo mount -t cifs -o user=whateveruser,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm //mybookworld/data ~/test
    Last edited by dmizer; March 25th, 2009 at 09:23 AM.

  4. #4
    Join Date
    Jan 2009
    Beans
    5

    Re: CIFS Mount with Guest Account not Work

    Quote Originally Posted by dmizer View Post
    The smb.conf file is strange. I've marked the problem points:
    Code:
    [global]
    server string=MyBookWorld
    workgroup=workgroup
    interfaces=192.168.1.117/24 127.0.0.1/8
    security=user
    smb passwd file=/var/private/smbpasswd
    private dir=/var/private
    guest account=www-data
    log file=/var/log/log.%m
    log level=1 auth:3
    max log size=50
    dns proxy=No
    lock directory=/var/locks
    pid directory=/var/locks
    use sendfile=Yes
    map to guest = Bad User
    So the share definition (not included in my excerpt above) indicates that guest is okay, but the global options indicate that guest is a bad user.

    You might have success by simply removing the "map to guest = Bad User" option from the worldbook smb.conf. I'm not sure why this was included and it doesn't make much sense given the rest of the smb.conf file.

    Or, try this:
    Code:
    sudo mount -t cifs -o user=whateveruser,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm //mybookworld/data ~/test

    Reply appreciated. But it unfortunately it does not work by marking the map to guest" line.

  5. #5
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,362
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: CIFS Mount with Guest Account not Work

    Okay, try this then:
    Code:
    sudo mount -t cifs -o user=whateveruser,pass=whateverpass,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm //mybookworld/data ~/test
    This should be a duplicate of what you say works in smbclient.

  6. #6
    Join Date
    Jan 2009
    Beans
    5

    Re: CIFS Mount with Guest Account not Work

    Quote Originally Posted by dmizer View Post
    Okay, try this then:
    Code:
    sudo mount -t cifs -o user=whateveruser,pass=whateverpass,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm //mybookworld/data ~/test
    This should be a duplicate of what you say works in smbclient.
    No, same error.

    Client side:
    mount error 13 = Permission denied
    Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

    But this time it has not message on server side. The /var/log/log.{clientname} was not changed, nor does

    smbclient //mybookworld/data whateverpass -U whateveruser

    work.

  7. #7
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,362
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: CIFS Mount with Guest Account not Work

    Humm ... if you still have the "map to guest = Bad User" commented out, you might want to reinable that.

    Double check to make sure you have all the necessary packages installed with this command:
    Code:
    sudo aptitude install smbfs

  8. #8
    Join Date
    Jan 2009
    Beans
    5

    Re: CIFS Mount with Guest Account not Work

    Quote Originally Posted by dmizer View Post
    Humm ... if you still have the "map to guest = Bad User" commented out, you might want to reinable that.

    Double check to make sure you have all the necessary packages installed with this command:
    Code:
    sudo aptitude install smbfs
    Thanks, dmizer. I've checked and found that everything are updated. And also I've restored the "map to guest" parameter back.

    Just have done a bit more, when I used type the command:

    sudo mount -t cifs --verbose -o guest,rw //mybookworld/data ~/test

    and got the output

    mount.cifs kernel mount options unc=//mybookworld\data,ip=192.168.1.117,ver=1,rw,guest,user=root,ver=1,rw,guest
    mount error 13 = Permission denied
    Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)


    So that means the guest parameter using mount.cifs are connecting to the Samba server via user root. So I doubt, probably I need to change the password of the user root, in smbpasswd file to an empty value, that might make the guest option work.

  9. #9
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,362
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: CIFS Mount with Guest Account not Work

    You may try disabling the unix extensions like so:
    Code:
    sudo mount -t cifs -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,nounix,noperm //mybookworld/data ~/test
    If there any way to determine the UID and GID in your Worldbook NAS? If so, you may have luck by including them (as well as nounix) in your mount command:
    Code:
    sudo mount -t cifs -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,gid=###,uid=###,nounix,noperm //mybookworld/data ~/test
    Also, check for (and install) any firmware updates for your NAS.
    Last edited by dmizer; March 26th, 2009 at 01:13 AM.

  10. #10
    Join Date
    Dec 2008
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: CIFS Mount with Guest Account not Work

    Quote Originally Posted by shyl View Post
    My issue is that I cannot connect the Samba share drive with guest account. The command I used is

    sudo mount -t cifs -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77,noperm //mybookworld/data ~/test

    But the error I got is

    mount error 13 = Permission denied
    Refer to the mount.cifs(8 ) manual page (e.g.man mount.cifs)

    The use of guest is incorrectly used in the above mount command. In addition, I have never seen the command constucted in this manner either, but I can't say whether it will work or not. The common construction is:
    Code:
    sudo mount -t //mybookworld/data ~/test -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
    I have left the guest directive in the statement, but I assure you it is incorrect usage. BTW, you are using the variable $HOME in the mount command. The tilde (~) is the logged in users home dir. In this case you should use the explicit directory name(/home/<yourname>/test).

    Be aware that not all options are for command line usage. Some are for fstab automount. Consider what you would need to do on a password protected share that you were automounting (ie: before anyone was even logged in). This is what the term guest is used for.

    I've also tested the connection with smbclient. Strange is that smbclient works fine. The command I used was:

    smbclient //mybookworld/data whateverpass -U whateveruser

    So my question here is that, what could possibly be the reason that the smbclient works but the mount.cifs does not?
    Your use of smbclient isn't using the guest option and therefore succeeds.

    If what you are after is mounting the share to the Linux file system without using your password then I would use a credential file.

    In other posts in this thread there seems to be some confussion on what is a guest when using a Samba; in paticular the Global directives of: bad user and guest account. I have described them here:

    # Bad user means "user not found in passwd/smbpasswd" if this occurs,
    # we will default to the guest account that we have defined
    map to guest = bad user
    guest account = smbguest

    Typically the guest accout is mapped to the account nobody, but I prefer to use an account I created ie;smbguest. Either way Samba checks the login name of the requestor (client) and comapres it to its database. If the login is not available it declares the user a "bad user" (maybe we should think of it as a bad name user) and maps the login to the guest account.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •