mount -t cifs fails if password is not read from prompt, how to fix?
3
votes
3
answers
2453
views
I can successfully mount a windows network drive/share using this command:
mount -t cfis //servername/sharename /mnt -o 'username=user,sec=ntlmssp'
as running this commands prompts a password to be input and then if correct mounts.
According to
man mount.cifs
I should be able to to this.
mount -t cfis //servername/sharename /mnt -o 'username=user,password=pwd,sec=ntlmssp'
or this
PASSWD='pwd' mount -t cfis //servername/sharename /mnt -o 'username=user,sec=ntlmssp'
However strangely both those commands fail with this message.
mount error(13): Permission denied
Now because our company does this "supersmart" thing to require passwords with **special characters** mine does contain a exclamation mark "!
". I know that this would have a special meaning to the command line shell, so I have escaped it properly such that if my password was pwd!
I would issue those two commands:
PASSWD='pwd\!' mount -t cfis //servername/sharename /mnt -o 'username=user,sec=ntlmssp'
mount -t cfis //servername/sharename /mnt -o 'username=user,password=pwd\!,sec=ntlmssp'
but still it does not work.
Connecting to Windows I do not have any particular feeling of urgency to hide my password (of appearing in the bash history) so I would be happy to find a way to skip the password prompt.
Mostly I would like to know what the problem is?
Lastly I have even tried a credentials file which also did not work.
Asked by fraleone
(897 rep)
Dec 11, 2019, 03:04 PM
Last activity: Jul 11, 2025, 11:01 PM
Last activity: Jul 11, 2025, 11:01 PM