Read the rest of the hint for 10 different ways to mount a server share....
- The browser way
Maybe you can find the server of your choice directly on the Finder sidebar, or you have to click on All on the Finder sidebar and then scroll through the server list. Double-click on a server and you will see the shared folders provided for guests, or someone with your username and password. Click on 'Connect as...' to authenticate with a special username and password.
This way may be the best way to access servers for a sporadical need. But for a daily need, access is too many clicks away, and maybe for every different server, a special authentication is needed. - The alias way
Mostly used: Make an alias of a mounted server (however it was mounted the first time) and place it directly in the dock, if you want a large cluttered Dock. Alternatively, if the Finder preference Show Connected Servers on Desktop is unchecked), place it on your Desktop. Finally, if you like order, place it in a folder with a groovy icon that's located somewhere on the hard disk and placed in the Dock. - The dialog box way
For a once-and-never-again server this is a fast way, but for daily use, very ugly: The Finder's Go >> Connect to Server dialog box, where you have to enter the name or IP adress of the server you want to connect to. You can create some bookmarks with the "+" button, and view the last connected servers in the History menu, but for often-used servers, I would call this method ugly.
Hint: Some people may not know that you can manually choose the file protocol in this dialog box. If you just enter the server name or IP adress, Finder tries to connect via AFP (Apple File Protocol). You can also add the prefix afp:// with the same result. Other possible prefixes are smb:// or cifs:// for Samba (commonly used for Windows environments), ftp:// (for read-only access to FTP servers) and http:// for WebDAV.
So I use this dialog box sometimes to make an SMB connection to a server I normally connect to via AFP (as SMB may provide other shared folders, or maybe I want to do a test). - The Scripter's way
Why a script? You can add the script to a helper application like Butler or Quicksilver, and your servers are just one click or keystroke away. You can write a one-liner AppleScript to connect to a server:
tell app "Finder" to open location "protocol://username:password@server/share"
Some examples:tell app "Finder" to open location "afp://admin:admin@macmini.local/music"The last line looks weird, I know: For AFP you can also use the string ;AUTH=NO%20USER%20AUTHENT instead of username:password -- it's the same as clicking on Guest access when authenticating to a server.
tell app "Finder" to open location "smb://admin:admin@172.17.61.12/documents"
tell app "Finder" to open location "afp://;AUTH=NO%20USER%20AUTHENT@macmini.local/music" - There are bookmarks, you must know...
Open a new TextEdit document, change to unformatted text mode via the Format menu, and enter a connection string with the same scheme shown in the Scripter's Way (but without the scripting code, of course):
protocol://username:password@server/share
Now select this line and drag-and-drop it onto your Desktop. You should get a new file with a bookmark icon. If it's just a text clipping icon, the syntax of your connection string was incorrect.
You can rename this bookmark to something clear and short, place it somewhere in a nice place (for example, a folder called Servers with a nice icon in my home directory that's placed in the Dock and set to Show as Folder, Show as List), and all your commonly-used servers are once again one click away. This is my preferred way -- I'm handling about 30 servers this way in my company. - Automation is all
Of course, you can drag an already-mounted server to the Login Items tab of the Accounts System Preferences panel. It will then automatically mount the next time you login. You can also drag the bookmark from method #5, an executable script from #4, or an alias from #2 there. - Mount-as-you-type
Not very common for local servers, but possible: Type protocol://user:password@server/share in the Safari location bar, and it will mount in Finder. - The Unix Admin way
If you didn't know this yet, as of Mac OS X 10.5 and later, autofs is implemented. Maybe you'll shout "wow" or "I already knew that", or maybe not. Anyway, let's consider one scenario: One folder in /Users/Shared (so that all users can access the servers) containing some servers you often use. You can drag this folder to the Dock for easy access. Then open a new Terminal session. First we'll create a file containing all necessary server links in the /etc directory; let's call it auto_mount: sudo pico /etc/auto_mount.
In this file, enter an arbitrary name for the server (please do not use blank spaces and special characters), followed by protocol and connection details. Some examples for different protocols:Pictures -fstype=smbfs :/admin:admin123@192.168.178.1/mylovelypicturesSave the file when done, and open the autofs master file: sudo pico /etc/auto_master. Append one line at the end containing the name of our newly-created file, and the name of the folder where you want to make the server connections appear:
Music -fstype=afp afp://admin:admin123@192.168.178.2/itunesmusic/Users/shared/servers auto_mount
Don't forget to create the folder /Users/shared/servers if it doesn't exist. Now just reload autofs: sudo automount -cv. Note that the passwords for servers that you've entered in the auto_mount file are readable by everyone that can access the computer. But I guess it's no big security issue, because everyone using the machine should access the servers, so everyone should know the password.
We should have a folder servers in the shared users directory with a server alias icon containing all the auto_mount defined server shares in form of a blank document alias icon. Double-clicking shows the contents of the server with the side-effect that it will not show up on your Desktop as a mounted server (even if you have checked the Finder preference "Show Servers on Desktop").
Why did I tell this? This way may be a good way for some environments with many users. Imagine: You just have to create the folder in the shared users directory (or somewhere else) and maybe drag it to the Dock. Then you have to create the the auto_mount file and edit the auto_master file. After that, if the servers in your infrastructure change, you just have to edit the auto_mount file of every client machine via ssh -- or copy a new one via scp to every client, and you're done. - The geek way
Of course, Unix can do what a GUI can do (and even more), so there's a method to mount servers via Unix shell. But I'm not sure if this way is really useful if you're not writing shell scripts that have to access servers. But to complete my article, here's the way to mount a server via bash in Terminal:
First we have to create a directory -- the mountpoint -- where the contents of the mounted server will appear. This directory can be anywhere on your hard disk; for a better tidiness I would recommend a folder with the name of the server share in a folder called mnt at the root directory. For example:
$ mkdir /mnt $ mkdir /mnt/music $ mkdir /mnt/movie
The mount command should be more or less familar:mount_smbfs //admin:stevie123@macmediaserver.local/itunesmusic /mnt/music ## for SMB shares ##When cding to the directory specified as the mount point, you should see the contents of the server share.
mount_afp afp://admin:stevie123@macmediaserver.local/mymovies /mnt/movie ## for AFP shares ##
On the Finder side: After executing the script, the folder /mnt/music gets a server-alias-icon, and when double-clicking, it shows the content of the server -- and the server also mounts on the Desktop as if it was mounted in the ordinary way. When ejecting, the server disk disappers and the mount point folder gets its old folder icon back.
Keep the unix slogan "think before you type" in mind. If the folder /mnt/music contains any files before the mount command, they will disappear after the mount command (but will come back after unmounting). When removing objects via the command line before the mount command (rm /mnt/music/*) will remove any file within the folder -- but it will remove any file on the server when executed after mounting!
By the way, you can unmount any server via command line with the umount command followed by the mountpoint path: umount /mnt/music - I want more
Of course, there are many applications that can handle servers for you. You have the choice between freeware, shareware, and commercial software; and menu bar, Dock, and/or Dashboard-integration. If the first nine methods weren't good enough for you, or software with a special intelligence like "mount this server if my home network is in range" is needed, there's a solution out there somewhere.

