Need to mount a specific directory from Windows to Linux:
mount -t cifs -o username=somebody password=12,34 //192.168.1.3/share /mnt/server
Notice that there is a comma inside the password, and that makes Shell mistake it as a separator.
How to deal with that situation?
Thanks!
Description of password option in man mount.cifs explicitely says, that you cannot use comma-contained password in command line:
Note that a password which contains the delimiter character (i.e. a comma ',') will fail to be parsed correctly on the command line. However, the same password defined in the PASSWD environment variable or via a credentials file (see below) or entered at the password prompt will be read correctly.
You may set PASSWD variable within same line as mount:
PASSWD=12,34 mount -t cifs -o username=somebody //192.168.1.3/share /mnt/server
Alternatively you may use credentials file, as described in this manual.
BTW, it is not shell who incorrectly interprets comma. Actually, username and password are both suboptions for -o option, and these suboptions should be delimited by comma for being correctly parsed by the program(mount) itself:
mount -t cifs -o username=<username>,password=<password> ...
And such suboption mechanism have no means to parse comma inside suboption's value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With