I've found instructions on how to auto mount an SMB share, but they either involve adding the share to the login items (I'm using a laptop and that gives me an error when I'm not in the same network as the SMB share), or adding my login and password into the fstab or auto_master file (if I change my password, as I should, I have to go reconfiguring the system).

My user and password are stored in the keychain, and I only want the system to mount the share when I'm in the same network. I'm lazy and I want this to happen automatically. Is it possible?

1 Answer 1


Yes, it is possible, but you'll either need an non-lazy friend or put in the work yourself in order to set it up.

First thing I thought of was creating a shell script that monitors your networks connection details and executes the appropriate autologin and automount commands when it sees that you are connecting to the right network.

So, to answer your original question, yes it is possible.

  • I use an app called ControlPlane that allows you to set various contexts that define which commands or scripts should run in different places. I specifically use it to automount shares depending on whether Im at home or work or using the vpn, etc. controlplaneapp.com
    – rchrdg
    Commented Feb 8, 2015 at 20:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .