A brief guide on how to automount SMB shares on a Linux machine joined to Active Directory
A brief guide on how to automount SMB shares on a Linux machine joined to Active Directory
Mounting a SMB share on login is actually pretty. You first need to login as an Active directory user. For the time being I can not get it to work on TTY only machines but at some point I will find a way. Once you have logged in verify you have a Kerberos kicket by running klist. You should see your user and a path to the ticket.
Next, find the fully qualified domain name of the server you are trying to mount. This will be the computername.domain. Once you have figured that out you need to find the name of the share you are mounting.
Next, test mount the share with gio mount "smb://fqdn/sharename"
with fqdn being the name from above and the share name being the share name. If everything worked, it should popup on your desktop. You should not need to enter a password as it should use the Ticket generated when you logged in.
If that worked you can make mount for all users on login with a desktop file. run sudo nano /etc/xdg/autostart/mount.desktop
and put this inside
[Desktop Entry]
Name=mount SMB share
Comment=mount SMB share myshare
Type=Application
Terminal=false
Exec=/usr/bin/gio mount "smb://fqdn/sharename"
This should now work when a user logs in.