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:$pass@my.host.com:/share /Volumes/share

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

Any ideas?

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

3 Answers

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" //example.com:/share or you use the credentials option to provide the path to a file containing the user credentials (also see mount.cifs(8)).

link|improve this answer
feedback

Have you tried enclosing the password phrases in quotes?

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

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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