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.


You better use a credential file

-o credentials=filename|cred=filename
specifies a file that contains a username and/or password and optionally the name of the  workgroup.
The format of the file is:

  • 1
    The problem remains. 1) Even with credentials file it does not work. I only works if supplied via password prompt. Any idea? – fraleone Dec 11 '19 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.