July 11th, 2002, 08:26 PM
Very Basic Samba
This is the basic configure for setting up a Samba (Linux file sharing on a windows network) Server. In this case, it is assumed that you are on an NT Domain, and have an NT/2K machine set up as the primary domain controller.
The linux config is done in the file /etc/samba/smb.conf. In previous versions of samba, the file was /etc/smb.conf. The following instructions are starting with a blank smb.conf file. You can remove all the excess information in the standard file.
This all takes place in the [GLOBAL] section (first section) of the file.
- Make sure that the file exists first.
- Open the file in your favorite text editor.
- Make it look like this:
- log file = /var/log/samba/log.%m
- security = DOMAIN
- password server = <your NT Domain controller>
- workgroup = WORKGROUP
- server string = Samba computer
- encrypt passwords = yes
- preferred master = no
- domain master = no
****NOTE, If you are running Windows XP Home edition, this will not work. XP Home can not logon to a domain. If this is the case, change the line "security = DOMAIN" to say "security = SERVER"
This does not include the information for setting up actual shared folders. For that, see below..
NT server config
This is probably the most simple of all, but must be done. This is only if you have security = DOMAIN. If security = SERVER, I believe that you can skip this step, although I am not sure as I have not tested it.
- Click Start -> Programs - Administrative Tools -> Server Manager
- Once it opens, click Computer -> Add to domain
- In the new window, make sure NT Server or Workstation is marked
- Type in the name of the new Linux box that is running samba on it.
- Click ok.
- End the program.
As I said, very simple, but if you don't remember it, the samba machine will not be able to verify passwords on the network.
File share config
This also takes place in the smb.conf file that you created earlier. This will be after the global settings. We will create a share for everyone to have read/write access to one public directory.
- Change to the root directory cd /
- Make a directory named public mkdir public
- Make the directory read/write/execute by all chmod 777 public
- Open the smb.conf file and add this at the end:
- comment = Public Directory
- path = /public/
- public = yes
- writeable = yes
- guest ok = yes
Now, for a basic directory where only one person has access to the directory. Place this after the [public] section in smb.conf. We will assume that we want the user lsoule to have access to his home directory. Therefore there must be a directory called /home/lsoule/ on the machine.
- path = /home/lsoule/
- valid users = lsoule
- writeable = yes
Starting the service
**Note When you make changes to the smb.conf global section, you must restart the smbd and nmbd daemons.
- The first time you start this, type smbpasswd -j <domain> -r <computer>,if the domain is WORGROUP and the PDC is PDC_1, then:
smbpasswd -j WORKGROUP -r PDC_1
This is only necessary the first time you start the daemon. If you have a problem, you will need to redo the NT server config. This is if security = DOMAIN not if security = SERVER.
- Type /etc/rc.d/init.d/smb status to check the status of the daemons.
- Type /etc/rc.d/init.d/smb restart to restart the daemons.
Remember, this is a very basic setup. Once I actually take the time to set up a Samba machine as the PDC, I will post a more complete tutorial, which will also include a lot more of the options that are possible in the file share config (like admin users and printers).
\"Ignorance is bliss....
but only for your enemy\"
July 11th, 2002, 11:36 PM
Every now and then, one of you won't annoy me.
July 12th, 2002, 07:08 AM
I am going to be setting up a Linux file server on my NT network in a few days. This is going to help a ton!
July 14th, 2002, 12:39 PM
thanx! I have two linux books and neither of them described setting up the smb.conf file as clear as you did. Maybe I just bought the wrong books, thanx again!
A great oak is the end result of a nut who stood his ground.
July 14th, 2002, 12:58 PM
July 14th, 2002, 01:10 PM
Your tutorial dealt with setting up file sharing from a linux box on an NT domain, and I got that to work. However, is there a way to get a linux workstation to authenticate to a WinNT domain controller and if so how? Thanks again.