Google


ADBRITE ads links
You are here: CodeIdol.com > Unix > Linux® Quick Fix > Samba Security And Troubleshooting > Testing Samba Client Server Network Connectivity

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

Testing Samba Client/Server Network Connectivity

After configuring basic network connectivity, you need to go through a variety of tests to determine whether Samba has been configured correctly both on the server and client. As part of a thorough troubleshooting procedure:

1.
Make sure your Samba server can see all the shares available on the network with the smbclient -l samba_server command. Press the Enter key when prompted for a password. Check your SWAT configuration for invalid hosts allow, hosts deny, and invalid users enTRies. Failure of this test may mean that Samba isn't running on the server at all and may need to be started.

[root@bigboy tmp]# smbclient -L bigboy
Password:
Anonymous login successful
Domain=[HOMENET] OS=[Unix] Server=[Samba 3.0.2-7.FC1]

         Sharename      Type       Comment
         ---------      ----       -------
         IPC$           IPC        IPC Service (Samba Server)
         ADMIN$         IPC        IPC Service (Samba Server)
Anonymous login successful
Domain=[HOMENET] OS=[Unix] Server=[Samba 3.0.2-7.FC1]

         Server                Comment
         ---------             -------
         SILENT                Samba Server

         Workgroup             Master
         ---------             -------
         HOMENET               BIGBOY
         OTHERNET              SILENT
[root@bigboy tmp]#

2.
Use the nmblookup -B samba-server-IP-address _SAMBA_ command on the server to determine whether the Samba software is running correctly. This should return the server's IP address if the software is running correctly.

[root@bigboy tmp]# nmblookup -B 192.168.1.100 __SAMBA__
querying __SAMBA__ on 192.168.1.100
192.168.1.100 __SAMBA__<00>
[root@bigboy tmp]#

3.
Use the nmblookup -B client-IP-address "*" command on the server to determine whether the client is accepting Samba queries. This should return the client's IP address if it is running correctly. If the test fails, check to see whether the client is running firewall software that could prevent communication. Another source of the problem could be that the Client for Microsoft Windows or File and Printer Sharing for Microsoft Networks settings on the client's NIC haven't been selected. You also could have entered an incorrect IP address.

[root@bigboy tmp]# nmblookup -B 192.168.1.103 "*"
querying * on 192.168.1.103
192.168.1.103 *<00>
[root@bigboy tmp]#

4.
Use the nmblookup -d 2 "*" command on the server to tell it to broadcast a query message to the network. This should return answers from all locally connected clients and servers. This test actually sends out a broadcasted request for information; it usually fails if either your client or server has an incorrect subnet mask configured on their NIC cards.

[root@bigboy tmp]# nmblookup -d 2 '*'
added interface ip=192.168.1.100 bcast=192.168.1.255
nmask=255.255.255.0
added interface ip=192.168.1.100 bcast=192.168.1.255
nmask=255.255.255.0
querying * on 192.168.1.255
Got a positive name query response from 192.168.1.100 (
192.168.1.100 )
Got a positive name query response from 192.168.1.103 (
192.168.1.103 )
Got a positive name query response from 192.168.1.100 (
192.168.1.100 )
192.168.1.100 *<00>
192.168.1.103 *<00>
192.168.1.100 *<00>
[root@bigboy tmp]#

5.
Use the smbclient //samba-server/tmp command to attempt a command-line login to the Samba server. When prompted for a password, use the Linux password of the account with which you logged in. You can test other accounts by adding the -U accountname option at the end of the command line. This should return a message that the login was successful. If you are doing this as user root, press the Enter key when prompted for a password.

[root@bigboy tmp]# smbclient //bigboy/TMP
Password:
Anonymous login successful
Domain=[HOMENET] OS=[Unix] Server=[Samba 3.0.2-7.FC1]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
[root@bigboy tmp]#

A message that warns of an invalid or bad network name could mean that the tmp service on the Samba server isn't correctly configured. Messages related to bad passwords could mean that the user's account doesn't exist, that their smbpasswd wasn't created, or that the password entered is incorrect.

6.
Log into the Windows workstation as a Samba user. (In the example below, the username is peter.) Use the net view \\samba-server command to log into the Samba server from the command line and get a listing of your shares.

If it fails, then make sure your hosts allow, hosts deny, and invalid users parameters are set correctly in your smb.conf file.

This test attempts to log in using the username and password with which you logged into the PC. Make sure the corresponding Samba user has been created.

A "Network name not found" message usually points to an incorrect NetBIOS configuration on the client. Add the IP address of the Samba server to the WINS server settings, and enable Windows name resolution via DNS using the advanced TCP/IP settings menu on the PC. You can get to this menu using the following method:

1. Click on the Network Connections icon in the Windows Control Panel.

2. Right-click on the network connection and select Properties.

3. Click on the Internet Properties (TCP/IP) menu option and then click on the Properties button.

4. Click on the Advanced button and then on the WINS tab.

You may also need to add the name of the Samba server to the PC's C:\WINDOWS\system32\drivers\etc\lmhosts file.

If you're successful you should see:

C:\>net view \\bigboy
Shared resources at \\bigboy
Samba Server
Share name   Type   Used as  Comment

------------------------------------------------
peter         Disk             Home Directories
The command completed successfully.
C:\>

If there is no user account, the test will fail and you will see:

C:\> net view \\bigboy
System error 5 has occurred.

Access is denied.
C:\>

7.
Log into the Windows workstation as a Samba user. Try to map a drive letter to the user's default login directory on the Samba server. This is done with the net use x: \\samba-server\share command. Here we want user "peter" to have a DOS drive X: map to Peter's Linux home directory on the Samba server.

C:\>net use x: \\bigboy\peter
The command completed successfully.
C:\>

Make sure your password encryption is set correctly in the smb.conf file. As stated in Chapter 10, "Windows, Linux, and Samba," newer versions of Windows send encrypted passwords only. Make sure you have correctly configured the encrypt passwords option in the [global] section of smb.conf.

Failure could also mean that the server's smb.conf file hasn't been configured to automatically use the PC user's username as the Samba login name. You can do this by setting the user=username option in the [tmp] section of the smb.conf file.

8.
From the Samba server, issue the nmblookup -M domain command to ensure that there is a master browser for the domain. Successful attempts should list the IP address of the master browser server. If not, you'll need to make sure that the preferred master parameter is set to yes in the [global] section of smb.conf.

[root@bigboy home]# nmblookup -M homenet
querying fedora on 192.168.1.255
192.168.1.100 homenet<1d>
[root@bigboy home]#

This may fail with some Windows NT clients if the Samba server has been configured not to use encrypted passwords. You will need to set the encrypt passwords option in the [global] section of the smb.conf file to yes. Remember that doing so may make logins from Windows 95/98/ME clients fail. As you can see, it is sometimes best to make all your clients run similar versions of the Windows operating system.

Once all this has tested positively, you should be able to see your domain under Windows' My Network Places located in file manager or in the Start Menu. You should also be able to browse through the shares as well.

    SAVE
    Digg
    Shown on del.icio.us del.icio.us
    See Whos Talking About This on Technorati Technorati
    I've Reddit reddit

    You are here: CodeIdol.com > Unix > Linux® Quick Fix > Samba Security And Troubleshooting > Testing Samba Client Server Network Connectivity
       
    Related tags







    Popular Categories
    Unix books and guides
    AJAX popular information
    C# language guides
    Windows books and cookbooks
    .......






    © CodeIdol Labs, 2007