Open Source and the Magic LAMP

Mount Cifs Linux Share

Posted in Business by jewelsjacobs on November 17, 2009

An alternative to mapping a directery on a Linux Server to a Windows PC / Server is mounting a cifs share.

First you need to request that your share be cifs vs. nfs

Here is an example of the syntax:

Add to /etc/fstab:

//sharehost/share$ /path/to/mount/directory cifs username=svc_username,password=somepassword

Note the svc account needs to be Linux / AD

Then run

mount /path/to/mount/directory

Tagged with: , ,

One Response

Subscribe to comments with RSS.

  1. BasketCase's avatar BasketCase said, on February 26, 2010 at 7:26 pm

    To protect the CIFS username and password from process listings and command line histories it is possible to put them into a separate file. Replace the username= and password= sections of the mount options with credentials=file

    The format of the file is:
    username=svc_username
    password=somepassword

    I also like to specify the uid and gid to use on the mount as well as file_mod=0644,dir_mode=0755 since Windows systems have a different idea of file ownerships and permissions.

    The directio mount option may also help performance depending on what type of access you are doing.


Leave a comment