How To Automount A SMB Drive In OSX

Posted by Weston Ganger on May 05, 2016

I wanted my SMB share to automount on my Macbook running OSX Yosemite.

It should have been easier than this to set this up but its a Mac.

First create a shares directory somewhere underneath your home folder. I had endless permissions troubles when placing it elsewhere.

mkdir ~/shares

Next edit /etc/auto_master

# /etc/auto_master

## Automounter master map
+auto_master # Use directory service
/net -hosts        -nobrowse,hidefromfinder,nosuid
/home auto_home    -nobrowse,hidefromfinder
/Network/Servers   -fstab

# Insert this line
/Users/my_username/shares auto_smb # WARNING: Whatever folder you choose here will be completely overwritten

/-                 -static 

Now we need to setup the auto_smb script. Create a new file at /etc/auto_smb

# /etc/auto_smb

my_share_name -fstype=smbfs ://username:password@ 

Lastly set the permission & reload.

# Set scripts permissions
sudo chmod 600 /etc/auto_smb

# Reload auto_master config
sudo automount -vc

Related External Links:

Posted in OSX and Tagged with smb osx 

Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts