Answers to: secure automatic connection to MS-Windows file share (cifs)http://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs<p>I can mount a windows file share with <code>sudo mount -t cifs -o credentials=~/Files/server-mount/credentials //sbs2008/local ~/Files/server-mount/</code>. I would like to do this but:</p> <ul> <li><strike>Without root privileges.</strike> (I can do this one, if I solve the other two.)</li> <li>Without storing password, unencrypted.</li> <li>Automatically on login.</li> </ul> <p>I am using kubuntu 11.10</p>enTue, 17 Apr 2012 10:33:02 -0400Comment by daves dad on Ron's answerhttp://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs#2833<p>Usualy I use sshfs, but I need access to a windows cifs file share. We can not give access to everyone so authentication is necessary. I do not want the password stored on the laptop, as a lost laptop will allow access (even if root only readable). With sshfs I store the key encrypted with a passphrase. If I had a solution that needed root privileges I can wrap it in a set uid.</p>daves dadTue, 17 Apr 2012 10:33:02 -0400http://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs#2833Answer by Seth Brownhttp://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs/2832<p>I could be wrong but I think the mount command ALWAYS requires root privileges to run.</p> <p>The best you can do, is to make ~/Files/server-mount/credentials read-only by root and do not share the root password.</p>Seth BrownTue, 17 Apr 2012 07:56:42 -0400http://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs/2832Comment by Ron on Ron's answerhttp://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs#2803<p>What is your ultimate goal? Maybe you don't want to do a Windows fire share at all, maybe setting up an autossh is the way to do it using keys, or an SFTP deal, more info please.</p>RonThu, 01 Mar 2012 17:40:01 -0500http://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs#2803Comment by daves dad on Ron's answerhttp://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs#2799<p>Yes fstab is a good idea (It does require root to set up, but you saw me use sudo above so know I can do this.). However the solution to stoping someone copying the key, is to remove the lock, is not going to help.</p>daves dadThu, 01 Mar 2012 05:33:08 -0500http://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs#2799Answer by Ronhttp://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs/2795<p>Without root privileges - Setup the share in fstab</p> <p>Without storing password - Make the "Everyone" user available with full access in the advanced permissions (sharing) on Windows PC</p> <p>Automatically on login - Setup the share in fstab</p>RonWed, 29 Feb 2012 18:10:53 -0500http://linuxexchange.org/questions/2793/secure-automatic-connection-to-ms-windows-file-share-cifs/2795