Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Storing passwords for SMB shares' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Storing passwords for SMB shares
Authored by: Anonymous on Nov 29, '01 10:27:26AM

Apple's HOWTO has a very interesting section on storing your passwords.

This means that you do not have to enter your username, password and workgroup everytime you connect, just smb://server/share.

All you need to do is create a file named .nsmbrc in your home directory. The file is of the following format:


where is the ip address of the server, etc.

You can have as many of these blocks as you like.

To protect your passwords, you should also chmod 600 the .nsmbrc file.

That done, has anyone had any success with automatically mounting shares on login? I guess you could produce a script using the mount_smbfs command, but then the mounts wont appear on the desktop.

[ Reply to This | # ]
Storing passwords for SMB shares
Authored by: james_sorenson on Nov 29, '01 03:01:18PM

I use the .nsmbrc file as well. However, you do NOT want to put in your
password as plain text.
In the terminal, run your password through this command:
smbutil crypt mypasswordhere
It will return a line of text that starts with $$.
Put that line of garbled text into the password field in your .nsmbrc file.
Works the same, but with added security.

as for mounting the server on login, I dragged my network directory onto the
Finder toolbar. Click on it, and it will log you in using the .nsmbrc file.
Not perfect, but it works well enough, for now.

[ Reply to This | # ]
Storing passwords for SMB shares
Authored by: bumpui on Feb 04, '03 03:20:28PM

it always asks me for a password whatever I do
or in

[ Reply to This | # ]
Storing passwords for SMB shares
Authored by: religon on Feb 19, '03 06:43:42PM

Does this work outside an Active Directory? Must the file server also be
the PDC? Must the file server be in the same domain that the user
authenticates to?

I have tried this where my file server resides in one domain and I
authenticate users with another domain using an NT 4 PDC. I assume
domain 1 (MOZART) and domain 2 (OAK) have a trust relationship.

My file looks like this...


NT032 is in the MOZART domain.
IMAUSER authenticates with the OAK domain.

I have been using BBEdit Lite to modify the hidden dot-file. I have been
saving it as UNIX line breaks.


Any insight would be appreciated.

[ Reply to This | # ]