syntax differences between autofs and mount_smbfs

| 1 Comment | No TrackBacks

If you are trying to establish static CIFS (aka SMB) mounts on your Mac, here are a couple hints that might save some time and effort.

If you need to specify the domain (say, if you are using Active Directory credentials), you need to escape the semicolon that divides the domain and the username. So if your map file is /etc/auto_smb, then you could use something like this example.

localmountpoint   -fstype=smbfs  ://DOMAIN\;\$    

You also need to escape the dollar sign if have such a character on your remote server's sharepoint (plus any funky characters in your password). Thanks Adam! If you do not, you'll get errors like

/sbin/mount_smbfs[2017] <Error>: smb_mount: mount failed to : syserr = No such file or directory    

and the icon in the Mac's Finder will be a broken alias. Note that you may need to enable verbose logging (which isn't terribly verbose) in /etc/autofs.conf file to get these messages in your system.log file.

If you're using mount_smbfs (or mount -t smbfs) via command line, on the other hand, it's unnecessary to escape the trailing $, but acceptable.

It would seem that your autofs map file could have the username, domain and password configured on a different file, as measure of security. This is normally done like this:

localmountpoint   -fstype=smbfs,credentials=/path/to/file  ://\$    

But that will result in an error message, like[341]: mount_smbfs: -o credentials: option not supported it's important to safeguard the map file if you're going to expose the credentials in plain text (chown root:wheel and chmod to 600).

In the man page for mount_smbfs, the wording suggests we could use the -N flag to bypass a password prompt and instead have mount_smbfs consult /etc/nsmb.conf. It says, "

Do not ask for a password. At run time, mount_smbfs reads the ~/Library/Preferences/nsmb.conf file for additional configuration parameters and a password. If no password is found, mount_smbfs prompts for it."    

However, the man page for nsmb.conf gives no indication that the password could be a valid key.

No TrackBacks

TrackBack URL:

1 Comment

I can't thank you enough for this post. I was having this issue for while & couldn't figure out a solution. I usually use this for Microsoft Windows where known as Microsoft Windows Network. I was almost ready to give up when I read this post. Thanks again for this invaluable resource.


Ahmad Merdang

Leave a comment

About this Entry

This page contains a single entry by Noah Abrahamson published on March 29, 2011 11:59 AM.

kickstart vs serveradmin for ARD ON/OFF was the previous entry in this blog.

Enable Logging with 10.7 SMBX (Windows File Sharing) is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.