How to pass a password with punctuation characters to 'mount' command?

8,512

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)).

Share:
8,512

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    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
      Prix over 13 years
      Why not using @$host
  • Abhishek A
    Abhishek A over 13 years
    rather single quotes