Using Samba to Automatically Mount Windows Network Shares at Login
This guide will show you how to mount windows network drives through a system called Samba. Once this is complete you will be able to access drives like your X drive (your user drive) as though they are part of your own system. Since this is an extension of the system used in Authentication this will only work properly when you are on BU’s own network, it will not work over VPN.
This guide assumes you have already completed the steps in Authentication. It will also only work on openSUSE 11.1 or later, if you are using an earlier version of openSUSE please go to Pam_Mount to accomplish the same steps manually.
- First, open Yast. Click on the Network Services button on the left and then the Windows Domain Membership button on the right. This will open the Authentication dialog you saw earlier. Click on the “Expert Settings” button about half way down the window on the right hand side to switch to the advanced configuration settings
- At the bottom of this window will a blank area labelled “Mount Server Directories”. At the very bottom left click the “Add” button to add a network drive. Another configuration dialog will open. There are three options you will need to set: Server Name, Remote Path, and Mount Point. You will not need to change Options or User Name.
- The network drives have the form \\Server_Name\Remote_Path or smb://Server_Name/Remote_Path. Server_Name should go in the “Server Name” box in the configuration dialog while Remote_Path should go in in the “Remote Path” box. So for \\eng-support\support the server name “eng-support” and the remote path should be “support” (both without quotes). If there are any backslashes in the path make sure you change them to forward slashes. So for \\eng-courses\courses\eng_courses you would have “eng-courses” and “courses/eng_courses”. This means it is mounting the folder eng_courses within the share courses. You can mount any specific folder you want on the network drive by specifying its path in that manner. If the server name has .bu.edu in it you can remove that part, it is optional.
- The Mount Point is where you want the folder placed on your local computer. BU Linux defaults to /ad/eng/, so for example /ad/eng/users for \\\eng-home\users\ or /ad/eng/courses for \\eng-courses\courses\eng_courses. This will mount the folder in the directory “eng”, which is a subdirectory of of the folder “ad” located in your root ( / ) directory. You can choose any folder you want, I personally leave out the /eng part and just mount everything in /ad. The mountpoints should not have to already exist, the program is supposed to automatically create them (although it doesn’t always). They should not be folder that already have files, though.
- Once you have set the Server Name, Remote Path, and Mount Point you can click OK. Add as many remote directories as you want. Once you are done click OK and then OK again to save your settings. Allow it to install any software it says it needs and then reboot your computer. The directories should be available. If they are not, check the Windows Domain membership module to see if they are still there. If they aren’t, you will need to install the pam_mount program and input the settings again. If that still doesn’t work try creating the directories. You will want to set them to be readable and writable by everyone. To make the directory, open a terminal, then run “sudo mkdir directory” for each directory. You will need to make each directory before you make subdirectories (for instance you must make /ad before you can make /ad/users). Then run this command for each directory “sudo chmod 777 directory“. This will give all users write access to this directory.