I want to mount a password-protected SMB share (served by a Windows machine). The share is protected by a user name and password, and I may not write the password in a file, I want to be prompted for the password at mount time.
I need a solution that works even for when the user on the client machine does not have any administrative privileges, so whatever method is used to mount the share must not allow him to get root permissions. The initial installation can be done as root. Users must be able to specify arbitrary server names. My immediate need is with Ubuntu 12.04, but the wider applicable a solution is the better.
The client is headless, so I'm looking for a command-line tool.
What I tried:
mount.cifs: while it can be made setuid root, its authors do not consider it secure. Running it under
sudohas the same problem.
fusesmb: I couldn't convince either of them to prompt me for a password.
- Nautilus and gvfs:
gvfs-mount smb://servername/sharenamefails with
Error mounting location: volume doesn't implement mount.
How can I mount a Samba share from the command line, as a non-root user, with a password prompt?