Problem with mount.cifs
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jan 2010
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with mount.cifs

    The task: how to let users run cron scripts to backup to a window's share on the local network.

    First attempt was:

    # chmod +s /sbin/mount.cifs
    # chmod +s /sbin/umount.cifs
    > mount.cifs //ls/backup /home/backup credentials=/home/fred/.smbpasswd
    This mount.cifs program has been built with the ability to run as a setuid root program disabled.
    mount.cifs has not been well audited for security holes. Therefore the Samba team does not recommend installing it as a setuid root program.

    Second attempt was to add a line to /etc/fstab:

    /home/backup //192.168.0.110/backup cifs username=fred,password=xxxxxx 0 0

    which resulted in:

    # mount -a
    Couldn't chdir to //192.168.0.110/backup: No such file or directory

    Performing the mount interactively works without problems:

    # mount.cifs //ls/backup /home/backup credentials=/home/fred/.smbpasswd

    as does using the file manager. Mounting via /etc/fstab worked on a RHEL 5 machine.

    Suggestions on how to solve the task gratefully received. I am using an up-to-date Fedora 12.

  2. #2
    Join Date
    Oct 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like something was "fixed" -- I do the same thing, now all of my scripts are broken. Could development please "unfix" this?

  3. #3
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    8,061
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I read this thread yesterday, but only today got a chance to see if my script to cifs mount a windows partition was broken or not. Yep, busted. I had in the past been able to use mount.cifs/umount.cifs by doing chmod 4755 to those files to allow running the script as a regular user. Yeah, they killed that with this latest update.

    I suppose if you want that feature back, you could:

    # yum downgrade samba-winbind-clients samba-common samba-client libsmbclient

    The package that actually installs the mount.cifs and umount.cifs files is samba-client.

  4. #4
    Join Date
    Oct 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup... I downgraded and added samba-client and samba-common to the exclusion list in yum.conf. What a PITA...

  5. #5
    Join Date
    Jan 2010
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many thanks for the confirmation Pablo and Munchee.

  6. #6
    Join Date
    Mar 2006
    Posts
    892
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Every time samba updates it undoes the SUID on mount.cifs and umount.cifs. So I made a copy of both in /usr/local/bin and all my scripts point there. I think now those two files will be imortalized for future distro upgrades.

    ---------- Post added at 09:46 PM CST ---------- Previous post was at 09:36 PM CST ----------

    This mount.cifs program has been built with the ability to run as a setuid root program disabled.
    mount.cifs has not been well audited for security holes. Therefore the Samba team does not recommend installing it as a setuid root program.
    This statement seems to imply that setuid can be re-enabled.
    jbkt23
    Thinkpads Depends on era T23 - X2xx
    AMD & Intel Boxes

  7. #7
    Join Date
    Jul 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have problem with mounting Windows shared folder in Fedora (12, recently installed) too. It is properly mounted by root, but I can't find a way to able user to do that:

    I add to fstab
    Code:
    //<win machine ip>/Shared /mnt/Shared cifs username=<win user>%<win password>,uid=user,gid=user,file_mode=0777,dir_mode=0777,user,noauto 0 0
    and executing mount /mnt/Shared works for root, but not for user, saying:

    not installed setuid - "user" CIFS mounts not supported.
    After doing
    Code:
    chmod u+s /sbin/mount.cifs
    chmod u+s /sbin/umount.cifs
    mount /mnt/Shared by user print following message:

    This mount.cifs program has been built with the ability to run as a setuid root program disabled.
    mount.cifs has not been well audited for security holes. Therefore the Samba team does not recommend installing it as a setuid root program.
    with no mounting result. Does anyone know what to do???

  8. #8
    Join Date
    Jan 2005
    Posts
    5,057
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    Join Date
    Jul 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I see, but what if I'm not looking for so high security and still wants to use samba being setuid as root because no one except trusted people have access to this client computer? Should be wait for further updates or could do something?

  10. #10
    Join Date
    Mar 2006
    Posts
    892
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I don't think the samba team thought through the consequences of their action. When I get a chance I will file a Fedora bug against the samba software. This action breaks a lot of the usability for my users.

    ---------- Post added at 12:46 PM CST ---------- Previous post was at 12:38 PM CST ----------

    Here is more of the samba developer discussion.

    http://lists.samba.org/archive/samba...er/067058.html
    jbkt23
    Thinkpads Depends on era T23 - X2xx
    AMD & Intel Boxes

  11. #11
    Join Date
    Oct 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can understand the concern based on the links provided, but if I run chmod u+s as root on MY machine, then I would expect MY machine to act as I have told it to do . That seems to be missed in the discussion, imho.

  12. #12
    Join Date
    Jul 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by munchee13
    if I run ... as root on MY machine, then I would expect MY machine to act as I have told it to do...
    Golden words, I fully agree with you, it's so right!!! The Bill's concept that user is fool even administrator one finally came to linux too. It could easily kill linux and turn into another virus (as in that rpmfusion's game lol) too.

    I understand that samba should warn root about this security issue as well as give direct advice how to bypass the restriction. Please, respect users!

  13. #13
    Join Date
    Nov 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with mount.cifs

    Update: I ran in to this issue with Fedora 14 and came across this thread searching for an answer. Just in case someone else does the same thing I wanted to note that this issue has been 'resolved' in that you can now use
    Code:
    chmod u+s /sbin/mount.cifs
    ... to enable unprived users to mount cifs shares.

  14. #14
    Join Date
    Mar 2006
    Posts
    892
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with mount.cifs

    Thanks for the update. I've been using the same mount.cifs binaries that came with F10 for every Fedora version since. See post #6 in this thread. I will test these updated binaries and see how they work and if they pass the test then I will copy them to /usr/local/sbin/.
    jbkt23
    Thinkpads Depends on era T23 - X2xx
    AMD & Intel Boxes

  15. #15
    Join Date
    Aug 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Re: Problem with mount.cifs

    I had the same problem with "SELECT INTO OUTFILE" iin a cifs file system.
    I confirm the solution was "chmod u+s /sbin/mount.cifs", now I can dump my tables in my linux data base server and show in my windows front end.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Mount.cifs problem
    By daniel_owen_uk in forum Servers & Networking
    Replies: 4
    Last Post: 30th March 2006, 04:29 PM
  2. mount.cifs and samba problem
    By hammel in forum Servers & Networking
    Replies: 1
    Last Post: 1st January 2006, 02:10 PM

Tags for this Thread

Posting Permissions

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