Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: SMB/CIFS share problem with comma in password
#1
Hello!

There seems to be a problem with commas in the password of a SMB/CIFS share.
Tried a while to get a share to work and alway got "Permission denied" and was wondering, why via ssh-shell everything works fine.
But via ssh I entered the password at the prompt and had no problem withe the comma in my password. 
Maybe the commandline moode uses to mount shares will be corrupted by commas in the password.

Philipp
Reply
#2
(10-09-2020, 09:11 PM)philippmoode Wrote: Hello!

There seems to be a problem with commas in the password of a SMB/CIFS share.
Tried a while to get a share to work and alway got "Permission denied" and was wondering, why via ssh-shell everything works fine.
But via ssh I entered the password at the prompt and had no problem withe the comma in my password. 
Maybe the commandline moode uses to mount shares will be corrupted by commas in the password.

Philipp

Have to answer myself, because i found the confirmation for my thoughts:

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.

Philipp
Reply


Forum Jump: