I am trying to setup an automount point using autofs to mount a samba fileshare. I am using the following syntax in my auto.misc filemydir    -fstype=cifs,rw,user=myusername ://server.domain/path/to/mountThe problem is that it is denying me with NT_STATUS_WRONG_PASSWORD (seen in /var/log/messages with -verbose turned on). It works if I add my password to the mount options using 'password=secretPass123'. I don't want the password to be stored on disk, so I would like it to prompt me for the password. When I mount it manually using mount if I leave out the password option, it does prompt me for the password. How do I get autofs to do the same?I am using CentOS 6.5.
autofs does not prompt for password when needed
linux;centos
I do not think you can have autofs prompt you for a password. You typically have to store it in a credentials file and reference it in automount file. This is how I've dealt with it in the past.Exampleshare1     -fstype=cifs,rw,noperm,netbiosname=${HOST},credentials=/etc/credentials.txt ://winserver/share1This file is then locked down like so:$ ls -l /etc/credentials.txt -rw-------. 1 root root 54 Jun 14 12:29 /etc/credentials.txtcontaining this:username=somdom\user1password=secret123!It's not ideal but is the best you can get with autofs. The other approach is to defer mounting to the users themselves and let them do it on demand using gvfs.You can also use pam_mount which I cover in detail in this U&L Q&A titled: Proper way to mount samba share.ReferencesHow to use my login password to do two thingsProper way to mount samba share