Display computer name only in Samba shares

May 01, '03 09:19:00AM

Contributed by: Drewpy

I have never had a problem with Samba and networking. The only thing that irritated me was when in Windows, my laptop would be seen as "Samba 2.2.3a (build 26) iBook (IBOOK)." This is long and silly. I wanted for it to just say the name of the computer. After reading a few other hints on Samba, I got started. I figured the clue would be in the /etc/smb.conf file (which it is). The first step is to back up the conf file. In terminal type:

  % sudo cp /etc/smb.conf /etc/smb.conf.bak
Second Step. Edit it. Open it up and you'll find there are a few categories each in [brackets]. The first one is called "global." This contains all the settings for Samba in general. The default is this:
  [global]
  client code page = 437
  coding system = utf8
  guest account = unknown
  encrypt passwords = yes
Note that there maybe an extra line if you have changed the name of the workgroup. After encrypt passwords = yes, simply add another line which says server string = %h - this will mean (after saving and restarting Samba) that Windows will just see your Samba server by the name of the computer. Alternativley, replace the %h with any text you like and that will be the name of the server.

By the way, Windows XP lists the computers by the name, and then the address in brackets afterwards. So now my iBook in windows looks like iBook (Ibook). Still, it doesn't confuse the people on my network that doesn't know who Samba is anymore!

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030427132911582