2

How do I properly mask/escape illegal characters like /:@\ in passwords added in the mount command?

The question arose in the answer here:

mount -t afp afp://adminname:password@ServerIPAddress/ShareName /Volumes/TimeMachine

The asking person had a backslash "\" in the password and the command didn't work. The solution were single quotes around the afp...-part.

Testing the whole scenario in a VM, I created an admin with a password similar to aaaaa\@11111, but I haven't been able to get the mount command working.

5

Use URL encoding to protect the wonky characters in the password. Essentially each character (or byte of UTF-8) can be encoded as a % followed by two hex digits specifying the encoded byte. In your example, \ -> %5C and @ -> %40:

mount -t afp afp://adminname:aaaaa%5C%4011111@ServerIPAddress/ShareName /Volumes/TimeMachine

This worked in my test.

You must log in to answer this question.

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