Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a shell script that mounts several samba shares one after the other. I want my users to have to enter in their password only once. I can pass in a password using the following,

mount -v -t smbfs -o nodev,nosuid //$user:$ /Volumes/share

This doesn't work when there are weird characters such as '^' or '.' in the password.

Any ideas?

share|improve this question
Why not using @$host – Prix Aug 13 '10 at 23:52

You can either use the user and password options for the mount.cifs command (see man page mount.cifs(8)) like mount -o ...,user="foo",password="bar" // or you use the credentials option to provide the path to a file containing the user credentials (also see mount.cifs(8)).

share|improve this answer

You have to URL encode the special characters (weird characters) on a Mac, because "mount_smbfs: -o user: option not supported". So, in your example, '^' = %5E

URL Encoding here:

share|improve this answer

Have you tried enclosing the password phrases in quotes?

share|improve this answer
rather single quotes – greenmang0 Aug 14 '10 at 5:58

Try to surround the entire options expression with quotes, i.e. mount -v -o "...".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.