Samba is a set of programs that will allow you to have your windows "home" directory follow you from computer to computer when you are using Microsoft's operating system. Obviously, samba only runs on the linux server. Getting samba is very easy: it usually comes with your distribution. Make certain you are using at least version 2.05 or you will have all sorts of problems. If you want to get the source code and compile it yourself, goto: SAMBA. After samba is installed, you only have to do three things to start sharing resources: edit samba's configuration file, set up the passwords, and then configure windows to use a domain login.
Configuration File: samba is configured from the file: smb.conf. It is located either at /etc/smb.conf or /usr/local/samba/lib/smb.conf. It can do many things, but we will be concentrating on sharing the home directory from your server. The smb.conf file has several sections, with the section name enclosed by [ ]. The first section to edit is [global]. Here are the essential parameters:
workgroup = KULAI
encrypt passwords = Yes
smb passwd file = /etc/smbpasswd
password level = 8
username level = 8
socket options = TCP_NODELAY
domain logons = Yes
domain master = yes
os level = 65
preferred master = Yes
wins proxy =no
wins support = yes
hosts allow = 192.168.124. 127.
logon script = logon.bat
Here is an explanation of the entries:
|workgroup||use whatever workgroup name your windows computers use|
|encrypted passwords||if you are using win98, you need this. See below how to use it|
|smb passwd file||location of the encrypted passwords|
|password and username level||level 8 means: case insensitive for name and password|
|socket options:||this value speeds up the network connection|
|domain logons||this is the key! See below|
|domain master||for home use there is only one master!|
|os level||the higher the better, but 65 is fine|
|preferred master||necessary for sharing directories|
|wins proxy||we are not proxying anything|
|wins support||needed to share directories|
|logon script||name of the file the window computers will execute on login. Not necessary, but could be nice. NOTE: this must be a DOS -not unix- formated file! Carrage returns are mandatory!|
What this [global] section does: samba will now become a domain master, which means that your samba server will act as a login manager and will store personal files and settings. Windows users will now logon to your samba domain instead of just the computer they are at. The directory c:\windows\profiles\user will be copied to the samba server when the window user logs off, and copied from the samba server to the window's computer when a user logs on. And it works no matter which computer you login to, so your files in My Documents, your start button menu, and your favorites follow you to whatever computer your at. As an example, a listing of /home/jpollman/profile on the linux server gives:
Application Data/ Favorites/
NetHood/ Start Menu/
Cookies/ History/ Temporary Internet Files/ Desktop/ My Documents/ Recent/ USER.DAT
Another nice feature of this is that these same files are available to you when you are in Linux since they are in your home directory. The other sections from the smb.conf that need attention:
comment = Home Directories
read only = No
browseable = No
browseable=no means that the only home directory that will show up in network neighborhood is your own.
comment = Network Logon Service
path = /usr/local/samba/netlogon
public = no
writeable = no
browseable = no
path gives the location of the logon.bat listed in the [global] section.
path = /home/%U/profile
guest ok = Yes
browseable = No
path this will give each user his/her own data. %U=user
After you have saved the smb.conf file, you can have samba test your file to make sure there are no obvious errors by running the program: testparm. If it checks out ok, start samba by running:
smbd -D [enter]The samba package comes with many other programs and can do many other things - read the man pages and samba's web pages. Our goal here is just to get the domain working so you can have your window's "home" directory follow you to whatever computer you are on.
nmbd -D [enter]
Passwords: Unfortunately samba does not use the unix passwords, so you have to create the smbpasswd file. Starting with Win98, Microsoft uses encrypted passwords - which is a good thing, but requires a little extra work to set up samba. You could edit the windows registry to use unencrypted passwords, but since samba can handle encrypted passwords, why not let samba handle it. Samba comes with a program that will convert the unix user's passwords to samba, but we find it adds alot of "users" that we do not want having smb permissions. To make the smbpasswd file manually is pretty easy for the home user, and we recommend it. Note: each windows user you want to share their "home" directory must be a user on the linux server first (adduser). To create the smbpasswd file for a windows user, say for bmote:
smbpasswd -a bmote [enter]
answer the password questions, then
smbpasswd -e bmote [enter]
to enable the user. Do this for each user. Restart smbd and nmbd and you are done with the Linux side of the house.
MS Windows configuration:
1. goto Control Panel -> Passwords. On the top tab, click on User Profiles. You want to click on the second choice "Users can customize ...." and then you can select either, or both, of the two bottom choices. Then click on the OK button.
2. goto Control Panel -> Network. We assume you have tcp/ip setup. Click on "Client for Microsoft Networks" to highlight it, and then click on Properties. Check the box: "Log on to Windows NT domain..." and use your workgroup name from the smb.comf for your domain. We suggest you choose the Quick log on button below that until you have everything functioning. Click on the OK button. You do not need the netbeui protocol - in fact it will actually slow your network down, but you will need to have the Netbios over TCP/IP checked in the TCP/IP properties (if you do not have netbeui, it will be checked by default.)
3. After you close out Control Panel, you will have to insert the Windows install cdrom, and, surprise surprise, reboot.
4. The next time you start up windows your login screen with have three entries: User Name, Password, and Domain.