I have a SAMBA share I mount on my Mac from time to time. I do this in Finder with Go > Connect to Server..., typing smb:// into the Server Address field and pressing Connect. On the authentication dialog I choose to Connect Guest, and finally my remote share is mounted in /Volumes/<share_name>. This is great.

Can I achieve all of the above with a single command in Terminal? I tried some variations of the advice provided here, but there are two things missing:

  • how do I instruct mount to connect as guest?
  • how do I create the /Volumes/<share_name> directory on the fly, (so it doesn't have to exist before hand)?



1 Answer 1


In order to mount as "guest", you need to use another command: mount_smbfs

mount_smbfs -N //guest@server/share /some/existing/path

The "-N" is "don't ask for password" (type man mount_smbfs for more info).

As for the second part of how to create it on the fly (the path), I believe that it's not possible. The mount command doesn't create it on the fly and even the man pages mention the "correct" way is to mkdir first then mount.

See the man page for mount_smbfs.

  • 1
    Thanks for digging up the -N argument, that's what I was looking for. The creation/removal of the destination directory I can work around in a script.
    – Mike Mazur
    Mar 25, 2011 at 13:45

You must log in to answer this question.

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