Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: CIFS Mount with Guest Account not Work

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

    Re: CIFS Mount with Guest Account not Work

    Quote Originally Posted by capscrew View Post
    The use of guest is incorrectly used in the above mount command.
    I'm unsure what you mean here. I would sincerely appreciate a more detailed explanation. It's been used like that for as long as I can recall, unless I'm missing something. I'll admit that I don't use the guest option often though.

    Quote Originally Posted by capscrew View Post
    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:<snip>
    There must be a howto somewhere with an odd mount configuration, but it seems to work just fine even though the options are before the directories. In your revision, you left off the cifs mount type though:
    Code:
    sudo mount -t cifs //mybookworld/data ~/test -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm

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

    Re: CIFS Mount with Guest Account not Work

    Dmizer,

    I sure did leave the "cifs" out. Thanks for the correction.

    Let me explain my "incorrect use of guest" in the mount command statement. First let me say that I mount a smb share using the mount -t cifs command via a script in my own network. I added guest to the -o section and had instant failure, just as the OP described.

    I assume also that we both agree the mount option guest has nothing to do with the Samba Server guest directive.

    The -o section of the man page for mount is worth noting:
    Code:
     -o     Options are specified with a -o flag followed by a  comma  sepa‐
                  rated  string of options.  Some of these options are only useful
                  when they appear in the /etc/fstab file. ...
    And continuing in the mount.cifs man pages:
    Code:
     Options to mount.cifs  are  specified  as  a  comma-separated  list  of
           key=value pairs. It is possible to send options other than those listed
           here, assuming that the cifs filesystem kernel  module  (cifs.ko)  sup‐
           ports them. Unrecognized cifs mount options passed to the cifs vfs ker‐
           nel code will be logged to the kernel log.
    Finally the guest option:
    Code:
           guest
              don’t prompt for a password
    To my way of thinking, this means just what it says. It does not refer to a guest account in any way. I could have just as easily been called noprompt.

    Using the references in the man pages, my conclusion is as I stated before "...not all options are for command line usage. Some are for fstab automount... "

    The guest option is to suppress the password prompt when mounting cifs shares via fstab (automount). We can use a cred file for the same effect. But in a large environment I think I would rather not leave cred files exposed. Some day I will create a share and mount it via fstab with the option guest to see what happens. But that is for another day.

    Edit: I see another reference to my thought in the mount.cifs man pages. See:
    password=arg
    specifies the CIFS password. If this option is not given then the environment variable PASSWD is used. If the password is not specified directly or indirectly via an argument to mount mount.cifs will prompt for a password, unless the guest option is specified.
    The OP's problem was in understanding what a guest (or maybe a guest account) is. In this case the -o guest (even if there were no errors) was misguided.
    Last edited by capscrew; March 26th, 2009 at 06:17 AM.

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

    Re: CIFS Mount with Guest Account not Work

    Thank you for the clarity!

    Actually, to view all valid CLI CIFS arguments, you should view the manual for mount.cifs, which does include the guest option. Logically speaking, there needs to be a way to disable password prompting when mounting open shares if you're mounting from the CLI or from /etc/fstab.

    I will have to do reasarch, but it was my understanding that when using the "guest" option, the cifs mount actually does present itself as user "guest" to the server. It has been a very long time since I've researched this option so I am willing to admit that I could be wrong here.

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

    Re: CIFS Mount with Guest Account not Work

    Quote Originally Posted by dmizer View Post
    Thank you for the clarity!

    Actually, to view all valid CLI CIFS arguments, you should view the manual for mount.cifs, which does include the guest option.
    Did you miss the following in my previous response?
    And continuing in the mount.cifs man pages:
    Code:
     Options to mount.cifs  are  specified  as  a  comma-separated  list  of
           key=value pairs. It is possible to send options other than those listed
           here, assuming that the cifs filesystem kernel  module  (cifs.ko)  sup‐
           ports them. Unrecognized cifs mount options passed to the cifs vfs ker‐
           nel code will be logged to the kernel log.

    Finally the guest option:
    Code:
    
           guest
              don’t prompt for a password
    



    Logically speaking, there needs to be a way to disable password prompting when mounting open shares if you're mounting from the CLI or from /etc/fstab.
    I believe I addressed that too...
    Read the previous post again.


    I will have to do reasarch, but it was my understanding that when using the "guest" option, the cifs mount actually does present itself as user "guest" to the server.
    Users on any system are always explicitly created. There is no user "guest" created by Samba. There is, however, a mapping between the extant user nobody and the detection of a login that is not in the smbpasswd database.

    It has been a very long time since I've researched this option so I am willing to admit that I could be wrong here.
    But not before you poke your finger in my eye by telling me to read the man pages. . <CHIDE> I thought we were not supposed to tell others to RTFM. </CHIDE>

    In the future it might help for you to document your thoughts. As in, I think this and here is why, instead of just saying it must be this way.

    Edit:

    As a P.S. I found this statement interesting:
    "Note that '-o guest' is not intended to be an instance of '-o <username>',
    it's meant to specify an anonymous connection to the server with *no*
    username."

    Steve Langasek
    Debian Developer
    vorlon_at_debian.org
    Tue, 15 May 2007 12:43:10 -0700
    Last edited by capscrew; March 26th, 2009 at 10:34 PM. Reason: typo and clarity.

  5. #15
    Join Date
    Feb 2006
    Beans
    108

    Re: CIFS Mount with Guest Account not Work

    I was having a similar problem. mount.cifs was failing with error 13 (permission denied) when I used -o guest, but it worked with a username and password. This was on a share which allows guest access, as verified by the fact that smbnetfs was able to mount it as a guest just fine. I eventually found this bug report:

    https://bugs.launchpad.net/ubuntu/+s...mba/+bug/98658

    In short, try this: -o guest,sec=none

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

    Re: CIFS Mount with Guest Account not Work

    Quote Originally Posted by foresto View Post
    I was having a similar problem. mount.cifs was failing with error 13 (permission denied) when I used -o guest, but it worked with a username and password. This was on a share which allows guest access, as verified by the fact that smbnetfs was able to mount it as a guest just fine. I eventually found this bug report:

    https://bugs.launchpad.net/ubuntu/+s...mba/+bug/98658

    In short, try this: -o guest,sec=none
    @Foresto,

    Would you try something for me?

    Try this: -o sec=none (no guest at all)

    Let us know what response you get.

Page 2 of 2 FirstFirst 12

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
  •