I need to mount a samba share directory on Ubuntu 16.04. Although the samba share directory(served by a Ubuntu 12.04 machine) has no password protection, the mount command still prompts the password hint:

# mount // ~/target
Password for root@/

To my surprise, it will mount the samba share directory successfully whatever I input after the password hint.

I found a solution that can disappear the password hint:

mount -o password= // ~/target

Is there other solution can prohibit the password hint prompt?

  • Does this problem persist when you try it as a normal user? – dessert Dec 21 '17 at 10:22

Another solution is to have an entry in your /etc/fstab like:

// /root/target cifs username=root,password=,iocharset=utf8,sec=ntlm  0  0

After that you should/would be able to mount it:

mount ~/target

In the above example anybody can see the password in /etc/fstab. It can be prevented by having the password in another file /etc/nsmb.conf:


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.