Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If <code>mount(8)</code> can't just call the <code>mount</code> syscall on the filesystem, it looks for a program to help it. On FreeBSD and Mac OS X, those helper programs follow the naming convention <code>mount_XXX</code>, where <code>XXX</code> is the <code>-t</code> argument's value. </p> <p>That means you want to check the <code>mount_smbfs(8)</code> <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/mount_smbfs.8.html" rel="nofollow">man page</a>, which tells us about <code>-N</code>:</p> <pre><code>-N Do not ask for a password. At run time, mount_smbfs reads the ~/Library/Preferences/nsmb.conf file for additional configuration parameters and a password. If no password is found, mount_smbfs prompts for it. </code></pre> <p>Unfortunately the man page trail ends with one for <code>nsmb.conf</code> that doesn't <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/nsmb.conf.5.html" rel="nofollow">mention anything about storing passwords</a>. On FreeBSD 8.0, at least, the solution is <a href="http://forums.freebsd.org/showthread.php?t=1252" rel="nofollow">to put a <code>password</code> key with a plain text(!) password value under a <code>[SERVER:USER]</code> heading</a>. That would be type <code>C</code> according to the linked <code>nsmb.conf</code> man page.</p> <p>So it seems that you'll want to dump a pre-configured <code>nsmb.conf</code> into your user's <code>~/Library/Preferences/</code> directory and then call your <code>mount</code> command with <code>-N</code>. As far as I know you can't provide a hashed value, which is not especially awesome. I'll try to get access to a MacBook in a few hours to test this.</p> <p><strong>NB</strong>: This is <em>not</em> how to do it with the GNU toolchain. If you're on Linux, you're probably going to be using something like <code>mount.cifs(8)</code>. The correct solution in <em>that</em> case is the <code>credentials=filename</code> option (used after <code>-o</code>, of course), where <code>filename</code> is a file of credentials in <code>key=value</code> form, separated by newlines. See <a href="http://linux.die.net/man/8/mount.cifs" rel="nofollow">http://linux.die.net/man/8/mount.cifs</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload