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

Click here to return to the 'Avoid Finder problems with mount points' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Avoid Finder problems with mount points
Authored by: bluehz on Mar 14, '03 11:22:16AM

Great tip! Thanks... another nicety I have discoverd in using Samba, is that you can create a file called .nsmbrc in your home folder and fill it with information such that you don't have to enter your login/password each time you connect. Makes the process much easier.


# first create an encrypted password key for logging into
# your samba server. Use the same password you would
# normally use to login to the samba share
# use smbutil to create the encrypted password
# you must envoke smbutil as the user that the password is
# associated with. Replace "password_here" below with
# your password.

smbutil crypt password_here


# the cmd above will generate an encrypted version
# of your password. Copy it to the clipboard.

#Create a file in your home dir and name it .nsmbrc

pico ~/.nsmbrc


# Now enter the following data in the file:
# this is the MINIMUM I have found you can get away
# with. Character case matters also. I don't even have
# a defined workgroup on my samba server but the first
# line is required below. The must be in this order also.

# use the same info below if you don't have a workgroup


# this is the server name and ip


# this is the actual server name and then your username
# paste in the password you generated above with smbutil
# for the "password_here" below, no quotes. Replace
# USERNAME with the same username associated above
# with the password


# you can enter as many shares/password combinations as
# want - always in the form:
# passwrd=password_here

There are many more options for the .nsmbrc file and it took me a while to get it to work. Make sure to chmod 600 the .nsmbrc file. Seems particularly finicky about case and order or items. You can read more info about setting this up here:

and here is another sample .nsmbrc file with more annotation.

Does anyone have any idea why when I leave my share from my linux box mounted on the OS X box for extended periods of time - the CPU usage of the samba daemon skyrockets to 80-90% even without actually doing anything on the share?

[ Reply to This | # ]
Avoid Finder problems with mount points
Authored by: bluehz on Mar 14, '03 11:51:10AM

Another really usefull - but obscure options is mapping your usernames from your OS X box to the box you are mounting in samba. You create user mapping file with lines correlating remote user and local user.

# create user mappings file
# location is not important as long as you point to it
# in smbd.conf (see below)

pico /usr/local/samba/lib/

# then add remote = local for each user you wish to map
# for example, let say my username is jimbob on OS X
# box but everytime I mount the share volume I want to
# mount as root (that is root on the share volume) so I
# have editing capabilities everywhere. This assume you
# have root access to your share. So the single line in the
# file would be:

root = jimbob

# enter as many as you like, each on a single line


# Then to activate the users_map, add this line in your
# samba config file (usually called smbd.conf) - make sure
# to change path below to where you created your
# in above step.

username map = /usr/local/samba/lib/

# also handy in your smbd.conf is this line to prevent OS X
# from littering shares with invisible .DS_Store files.

veto files = /.DS_Store/

[ Reply to This | # ]
Avoid Finder problems with mount points
Authored by: amit_kr on Mar 14, '03 01:09:34PM

Could one of you explain why one cannot simply login on to the windwos share once, and use the 'Add to keychain' option (on the user/password dialog) to save the credentials? After that, opening the share will not require any passwords (also applies if you have a shortcut to a deep folder within the share)

[ Reply to This | # ]
veto files doesn't work?
Authored by: Mithrandir on Mar 14, '03 07:39:46PM

I can't this option to work on my machine. I put it under the default heading in the conf file. Does it need to go somewhere special to work propperly? This would be fantastic if it worked!

Also is there a way to stop smb from littering shares with the ._fileName resource fork hack?

There is a hide dot files option that also doesn't seem to work.

Any ideas?


Ultimate Art Gallery

[ Reply to This | # ]
veto files works like this...
Authored by: Mithrandir on Mar 15, '03 05:29:47AM

Yes veto files does work it just doesn't quite do what was stated earlier. It doesn't prevent the Finder from creating the annoying .DS_Store file but instead hides it and restricts access to it from users accessing your Mac SMB shares. So these files would not be listed on a Windows machine connecting to your Mac.

I wonder if there is a way to prevent this file from being written to SMB and other Shares? A Finder hack?


Ultimate Art Gallery

[ Reply to This | # ]
veto files works like this...
Authored by: rarpsl on Mar 15, '03 10:34:34PM
You Want .DS.Store files written since they are what represent the DeskTop file on the Server (ie: Icons and File Names, Location of the Icons, View Options, etc.). You also need ._File- Name files there since they are your Macintosh Resource Fork contents for file File-Name. The problem is that the .DS.Store and ._File-Name files are Not being set as Windows "Hide" files so they are "seen" by Windows users.

[ Reply to This | # ]
Avoid Finder problems with mount points
Authored by: tupholme on Mar 15, '03 12:08:47PM

I need to add a hint to my hint! On bug number 3, I have since discovered that the Finder refuses to work with the mount point folders if the containing folder has been opened at all since startup! That's to say that even if it is closed when the script is run, if the containing folder was open previously the Finder will have trouble coping with the change in state of the mount point folders and will not be able to open them subsequently.

Make sure that if you have had the containing folder open you close it before shutdown, otherwise your next mount will be scuppered when you restart and the Finder re-opens the folder!

[ Reply to This | # ]