The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mount CIFS in fstab

Discussion in 'General Discussion' started by tomdchi, Apr 6, 2012.

  1. tomdchi

    tomdchi Well-Known Member

    Joined:
    Feb 24, 2008
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    cPanel Access Level:
    DataCenter Provider
    Can someone give me a proper example of what the fstab entry should be for a cifs mount when using Centos and WHM? The example given on centos.org does not work. They say it should be:

    Code:
    //winbox/getme /mnt/win cifs user,uid=500,rw,noauto,suid,credentials=/root/secret.txt 0 0
    My thought is that the uid needs to be set to something else and/or additional options need to be used.
    I have been doing it manually and it works fine with:
    Code:
    mount -t cifs -o username=user,password=pass //192.168.1.1/cpbackup/backup
    I hope someone can help with this. Its a real pain to have to manually mount shares every time I reboot a server.
     
    #1 tomdchi, Apr 6, 2012
    Last edited: Apr 6, 2012
  2. tomdchi

    tomdchi Well-Known Member

    Joined:
    Feb 24, 2008
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    cPanel Access Level:
    DataCenter Provider
    bump, somebody out there has got to be using CIFS with a WHM server.
     
  3. flopunctro

    flopunctro Registered

    Joined:
    Jan 29, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Hi tomdchi,

    I am using CIFS shares for CPanel backup.

    (It has worked quite well in the past, seems that last week's update to 11.32 introduces some bugs in this, CPanel seems to not mount the share and to fail to notice this, so it starts the backup and the / filesystem fills up. I'm investigating this right now)

    Here's my config:

    /etc/fstab:
    //file.server.ip.addr/fileserver-share /mnt/backup-share cifs defaults,noexec,noauto,file_mode=0640,dir_mode=0750,credentials=/root/backup-share-credentials


    /root/backup-share-credentials:
    username=myusername
    password=mypassword


    The username and password are ofcourse defined on the fileserver.

    In WHM's "configure backup", I have checked "mount/unmount share" and "bailout if mount fails".

    I have 4 servers with this configuration. As I said, it has worked really well for the past 2-3 years, until last week's 11.32 update.

    HTH

    LE: typing the share's username and password in /etc/fstab is not recommended security-wise, because /etc/fstab needs to be publicly readable -- so with a minimum effort (upload of a PHP file-manager) any of your CPanel users could read it and mount the share and read all other users' backups. The credential file should be owned by root and have 400 permissions.
     
    #3 flopunctro, Apr 17, 2012
    Last edited: Apr 17, 2012
Loading...

Share This Page