Find the answer to your Linux question:
Results 1 to 7 of 7
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    CIFS mount on boot


    What is the best way to run a CIFS mount on boot, that requires a username and password for authentication?

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,499
    mount.cifs takes the credentials argument.
    With that you can define a filename containing username/password/domain.
    Place this file somewhere safe and with readonly for root (and root alone)
    You must always face the curtain with a bow.

  3. #3
    Quote Originally Posted by Irithori View Post
    mount.cifs takes the credentials argument.
    With that you can define a filename containing username/password/domain.
    Place this file somewhere safe and with readonly for root (and root alone)
    I have the CIFS mount manually working by going into the BASH and running the command as SU. What I would like to do is when a user logs in the command runs automatically for them. The user is a non SUDOer. Any ideas?

  4. $spacer_open
    $spacer_close
  5. #4
    I've appended the mount action to my /etc/fstab file and it now automatically mounts at boot time. Just what you're looking for.

    Here's what the line should look like:

    //192.168.1.9/documents /NAS9 smbfs user=username,passwd=password,fmast=775,uid=1000,d mast=777,gid 0 0
    remote server/directory mount pt type credentials (your values should be different)


    After you've added this then from the command line do "sudo mount -a" and that should be it.

    Good luck.

  6. #5
    Still learning here is this applied at the top of the fstab file or the bottom?


    Quote Originally Posted by bobmct View Post
    I've appended the mount action to my /etc/fstab file and it now automatically mounts at boot time. Just what you're looking for.

    Here's what the line should look like:

    //192.168.1.9/documents /NAS9 smbfs user=username,passwd=password,fmast=775,uid=1000,d mast=777,gid 0 0
    remote server/directory mount pt type credentials (your values should be different)


    After you've added this then from the command line do "sudo mount -a" and that should be it.

    Good luck.

  7. #6
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    is this applied at the top of the fstab file or the bottom?
    Should not make any difference where it is as long as it is on a separate line.

  8. #7
    Its good to have password file created and point in fstab using "credentials".

Posting Permissions

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