|Ken Milberg, Site expert|
If you need to run Red Hat Enterprise Linux 4 (RHEL4) along with a Windows client in an IT environment, then check out Samba. That's what I do in this tip, so follow me as I set up Samba-3 on a RHEL4 Server, acting as a file server, so that Windows-on-Intel clients can access file and print services in much same way that they would use Wintel servers.
Samba integrates Linux with Windows clients using the SMB Protocol. Samba can give you the ability to run NetBIOS over TCP/IP, WINS client/servers support, user authentication and file and print sharing. Samba can do so many things, and also runs on Unix, IBM System 390, OpenVMS and many other operating systems. Basically, Samba uses the TCP/IP protocol that is on the host machine.
First make sure you have the following Samba package installed:
[root@redken ~]# rpm -q samba
I would also make sure that all the following packages are installed:
- the Samba SMB server
- Samba (SMB) client programs samba-client-3.0.10-1.4E.2.i386.rpm
- files used by both Samba servers and clients samba-common-3.0.10-1.4E.2.i386.rpm
- and the Samba SMB server configuration program
From a Linux shell, type this command in to call up the GUI:
After putting in your directory and share name, you will be prompted with a question asking whether or not you want all users or just selected user to access this share. I would pick only selected users, as that will give you more security.
Make sure Samba is running.
If you don't wish to start Samba services from the GUI, you can always do this from the command line:
service samba start
Type this command to make sure the service is started by default:
chkconfig smb --level 345 on
You must also create a Samba user and configure the user password using this command:
smbpasswd -a username
You can also create a Samba user and configure the user password with the GUI.
If you don't want to be prompted by a network password from your Windows PC, you will then have to make sure you put the following line in your smb.conf file (Global section), as Windows will send over the encrypted password:
- workgroup = NT-Domain-Name or Workgroup-Name
workgroup = workgroup
encrypt passwords = yes
- server string is the equivalent of the NT Description field
server string = Samba Server
Here is a snapshot of the smb.conf file that relates to the shares that we have created.
path = /root
writeable = yes
guest ok = yes
comment = samba
path = /app
writeable = yes
guest ok = yes
In our case, we have made these directories writeable; but you have the option to enable read-only access, which is usually safer.
The configuration that we are using here is based on a network that is using a workgroup. Make sure that the workgroup that you define on your Linux server is the same one that you have defined on your PC. Workgroups are really not the best way to set-up your network, as there are security issues, but it's fine for this purpose.
Make sure that you have TCP/IP running on your Windows client, or else it won't work. You will also have had to define a user on your Windows client, else you won't be able to log-in to the Linux server.
A nice command to use is smbstatus, that will give you a good idea of who is logged on to the system, their hostname and login time information.
Samba version 3.0.10-1.4E
|ken||29004||kenlaptop||Tue Dec 6 13:36:16 2005|
|root||29004||kenlaptop||Tue Dec 6 13:35:14 2005|
|IPC$||29004||kenlaptop||Tue Dec 6 13:35:08 2005|
Here is the command to gives you what version of Samba you are using:
root@redken ~]# smbd -V
I have to say that Samba-3 works beautifully on RHEL4, and I had no problems configuring it and opening up my files on the Windows client.
This was first published in January 2006