How to pass a password with punctuation characters to 'mount' command?
Solution 1
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: http://www.w3schools.com/tags/ref_urlencode.asp
Solution 2
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)
).
Related videos on Youtube
Admin
Updated on September 17, 2022Comments
-
Admin over 1 year
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:[email protected]:/share /Volumes/share
This doesn't work when there are weird characters such as '^' or '.' in the password.
Any ideas?
-
Prix over 13 yearsWhy not using @$host
-
-
Abhishek A over 13 yearsrather single quotes