This article walks through setting up the automatic mounting of a network file service at login in MacOS X, using the University’s SONAS based file service as an example.
The essence of the process involves saving your password (and potentially username), in your keychain, then creating a login item associated with your account (analogous to a startup item in Windows) that will use the saved authentication information to mount the shared folder when you log in!
An alternative approach described at the bottom of this article provides a discretionary approach, where you decide when you want to mount the network folder, rather than doing it every time you login (probably more useful for mobile users).
If your computer is set up to log in to the University directory, then it should not be necessary to save the username and password as described here.
connect to the shared folder
when signing in -save the username/password by clicking on Remember this password in my keychain.
Create a login item
Having connected to it, go to the “System Preferences” collection (under the Apple menu, or through the relevant icon on the Dock). Open the “Users and groups” tool and (assuming your current login is highlighted), click on the “Login Items” tab.
Click on the “+” to add a new item
In the popup that opens, navigate to the share, highlight the “myhome” folder and click OK.
In combination with the saved username and password, this should cause the Mac to connect to and mount your SONAS folder automatically when you log in.
Create shortcuts or links
At this point you can create shortcuts using the terminal -eg. My “echome” folder is where my documents are stored when using the Science Computer Labs, so I could create a shortcut on my desktop as follows:
$ ln -s /Volumes/myhome/echome ~/Desktop/echome
There are other approaches, but this is probably the easiest -especially if you use a different username and password from the one you would use to connect to the SONAS server itself.
This will not work if you connect to your machine through ssh and you have not already mounted the remote file system -setting this up requires a more involved process.
An alias (rather than symbolic link) could be used instead of (or in addition to) the login item described above. This provides you with a way of setting up the connection when you want it to happen, rather than every time you log in. It could also be used to resurrect a connection that may have been severed for some reason without having to log out and back in again.
Simply drag the “myhome” icon from the list of folders on the server when viewed in the Finder, to your desktop, and this should be “double clickable”.
This will not work through terminal access.
I have changed my password, and the connection is not working correctly
It should happen next time you log in (or use the alias to connect to the network folder) -type in the new password, and make sure the “remember this password” box is ticked.
If this is not working for some reason, then you can edit the password information in your Key Chain. Items in your keychain can be edited using the Keychain Access utility (in Applications -> Utilities). The password will be saved in an item named something like the name of the server you are connecting to -in the example above, the keychain is called files.auckland.ac.nz.
Open this, expose the password (you will be asked for the password you use to log onto the Mac -which is not necessarily the password that has been saved), modify it as required, then save the change.