RHEL4 and Windows integration using Samba-3

Follow Ken Milberg as he sets up Samba-3 on RHEL4 server, so that clients can access file and print services like Wintel servers.

This Content Component encountered an error

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.

Configuration

For more Samba, RHEL links:

Configuration with the Samba net utility

A tour of the Red Hat Directory Server

Managing Samba: Windows network identity basics

First make sure you have the following Samba package installed:

[root@redken ~]# rpm -q samba
samba-3.0.10-1.4E
[root@redken ~]#

I would also make sure that all the following packages are installed:

  • the Samba SMB server
    samba-3.0.10-1.4E.2.i386.rpm
  • 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
    samba-swat-3.0.10-1.4E.2.i386.rpm

From a Linux shell, type this command in to call up the GUI:

system-config-samba

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.

  • [root]
    path = /root
    writeable = yes
    guest ok = yes
  • [app]
    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.

  • smbstatus

    Samba version 3.0.10-1.4E

    PID Username Group Machine
    29004 adm adm kenlaptop (192.168.1.100)

    Service PID Machine Connected at
    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
    Version 3.0.10-1.4E

    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

    Dig deeper on Linux administration tools

    0 comments

    Oldest 

    Forgot Password?

    No problem! Submit your e-mail address below. We'll send you an email containing your password.

    Your password has been sent to:

    -ADS BY GOOGLE

    SearchDataCenter

    SearchServerVirtualization

    SearchCloudComputing

    SearchEnterpriseDesktop

    Close