linux - Commas inside the password while using "mount" -


need mount specific directory windows linux:

mount -t cifs -o username=somebody password=12,34 //192.168.1.3/share /mnt/server 

notice there comma inside password, , makes shell mistake separator.

how deal situation?

thanks!

description of password option in man mount.cifs explicitely says, cannot use comma-contained password in command line:

note password contains delimiter character (i.e. comma ',') fail parsed correctly on command line. however, same password defined in passwd environment variable or via credentials file (see below) or entered @ password prompt read correctly.

you may set passwd variable within same line mount:

passwd=12,34 mount -t cifs -o username=somebody //192.168.1.3/share /mnt/server 

alternatively may use credentials file, described in manual.


btw, not shell incorrectly interprets comma. actually, username , password both suboptions -o option, , these suboptions should delimited comma being correctly parsed program(mount) itself:

mount -t cifs -o username=<username>,password=<password> ... 

and such suboption mechanism have no means parse comma inside suboption's value.


Comments