SharedDrive (Linux) - Mounting a Windows File Share

This document explains how to mount a Windows File Share in Linux (Debian).

Steps to Mount a Windows File Share on a Linux Web Server

Note: Pre-requisites include: having an OU in the Campus Active Directory, having an -OU account, having a Windows File Share to connect to, and a created Service Account with the correct permissions (Read Only, Read and Write, etc) to the file share.

All of the steps below take place on a Linux Web Server.

  1. Make sure autofs is installed by running the following commands:
    • sudo apt-get install autofs
    • sudo service autofs start
  2. Set up mount for web server by running this command in the root file system:
    • mkdir /www
  3. Edit /etc/auto.master to include the auto mount map for the /www directory:
    • [/etc/auto.master]
    • /www /etc/auto.www
    • [/etc/auto.www] <-- permissions should be 600, owned by root.
    • www -fstype=cifs,rw,uid="apache User",gid="apache group",username="service account",password="password" ://fileshareservername/sharename
  4. Create web server document root to be /www
  5. Configure the Kerberos client by editing \etc\krb5.conf. The krb5.conf file should look just like this:
    • [libdefaults]
      default_realm = LOGIN.WISC.EDU
      krb4_config = /etc/krb.conf
      krb4_realms = /etc/krb.realms
      kdc_timesync = 1
      ccache_type = 4
      forwardable = true
      proxiable = true
    • [realms]
      LOGIN.WISC.EDU = {
      kdc =
      kdc =
      kdc =
      admin_server =
      default_domain =

      AD.WISC.EDU = {
      kdc =
      kdc =
      kdc =
      admin_server =
      default_domain =


      krb4_convert = true
      krb4_get_tickets = false

      default = FILE:/var/log/kerberos/krb5lib.log

  6. The following commands can be used to test the Kerberos configurations:
    • kinit - get a fresh ticket granting ticket. (ex. kinit [serviceaccount]@AD.WISC.EDU)
    • klist - show which tickets have been issued
    • kdestroy - remove issued tickets
    • kpasswd - change kerberos password
  7. To manually mount the Windows File Share use:
    • sudo mount -t cifs -o user=[service account created earlier]@AD.WISC.EDU //fileshareservername/sharename www
    • It will prompt for the service account password.
    • Example: sudo mount -t cifs -o user=bucky@AD.WISC.EDU // www

Keywords:ubuntu linux ourdrive files server ad campus active directory map mapping drive mounted linux red hat server storage doit   Doc ID:22601
Owner:Dustin T.Group:Systems Engineering
Created:2012-02-09 15:38 CDTUpdated:2016-01-13 10:14 CDT
Sites:Campus Active Directory, DoIT Staff, Systems Engineering
Feedback:  0   0