FLASH FLASH XP Home and Samba Fix FLASH FLASH
Ok, here it is folks, I have done ALOT of testing that I have some to this conclusion. This is the fix for XP Home users who are using Samba. First I will tell you how to do it, and then if you wanna know why then you can read the rest.
Ok, here we go. Let me say first that there is NO security with this, it is all dependent on guest accounts. There is no other fix at the moment unless you wanna hack XP Home to become winbloz 2000 or your go out and spend the money, something us Linux users are not used to. So, if your just a general user and using XP Home with Samba, your not set up on a domain anyhow to utilize the security options.
1. Setup a general user who you would like to be your template user for Samba.
2. Type in these commands:
$ cd /etc/samba
$ cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
$ echo "your_new_username = administrator admin" >> /etc/samba/smbpasswd
After you have typed those in now we will modify the smb.conf. Make sure your smb.conf reflects what is here. if you have more than this, it's ok, just verify these are in there and are set to what these say or what they should say. where it says your_workgroup and the rest like that, please substitute your workgroup name, example MYWORKGROUP. Remember it should be the same as your XP box.
workgroup = your_workgroup
netbios name = your_computer_name
server string = your_computer_name
interfaces = your_network-ip-address/your_netmask
security = SHARE
encrypt passwords = yes or no, doesn't matter right now
null passwords = yes
preferred master = True
domain master = True
wins support = Yes
remote announce = ip_address_of_XP_machine/your_work_group
guest account = your_new_user
valid users = your_new_user
hosts allow = your_network-ip-address
all of your shares need to have this in the smb.conf
guest ok = Yes
read only = No
after that is done, save the smb.conf file and then enter this command
If it says anything other than "Test Services file OK" then verify the settings again in your smb.conf
Ok, first note, if you have an external WINS Server NOT on the Linux box, you can specify it in the smb.conf file by adding
wins server = your_wins_server_ip_address
wins support = from yes to no
ok, you can have one or the other, if you want the wins support, you CANNOT specify the wins server. If you want the wins server you CANNOT specity the wins support. The nmbd service will fail if you have both.
Now that we have done that, type in this command
$ nmblookup -M -
If you see your Linux box IP address next to _MSBROWSE_ then you are all good. Remember, for some reason if you have a DC like Advanced Server or 2000 Server or anything along those lines, do not set the preferred master and the domain master in the smb.conf. This will cause massive confusion on the network.
If you don't see your box and it says could not retrieve name, then don't worry just type in this command
$ cd /etc/rc.d/init.d
$ ./smb stop
$ ./smb start
give it a minute or two then try the nmblookup command again.
if you still don't see it, power down everything on the network except for the linux box, this will force the linux box to become the master browser if you needed to set that. If your not sure if you needed to set that, do it.
Now power everything back up if you had to do this, and enter your XP box. go into network neighborhood, and you should see your linux box there, and if you click on it you should see your shares. Now, create a new group either through the GUI or by command line, if by the gui copy down the id of the group. Assign the user to the group. Copy down the userid too. If you need to grab the user id from the passwd file you can do this
$ cat /etc/passwd | grep -i your_new_user | cut -f3 -d:
Now you must reset all the groups on all the shares, by doing this
$ chown -R the_userid:the_groupid /path_to_your_shared_directory
After all this you can get into Samba from wonderful XP. If your concerned about security, you can copy the files out of the shared to an unshared directory and so on back and forth.
I need a cig now, so I will explain in full detail why this is, and why you can't do it another way at this point and time. If you find any errors in this, please feal free to correct the typos by letting me know. Enjoy.