31.11. Samba Administrative Tools

The commands listed below are some that we use often, but many more exist. Check the man pages and documentation for more details and information.

smbstatus. The smbstatus utility is a very simple program to list the current Samba connections. To report current Samba connections, use the following command:


          [root@deep ] /# smbstatus
        

          Samba version 2.0.7
          Service      uid      gid      pid     machine
          ----------------------------------------------
          tmp          webmaster webmaster  3995   gate     (192.168.1.3) Sat Sep 25 19:40:54 1999

          No locked files

          Share mode memory usage (bytes):
          1048464(99%) free + 56(0%) used + 56(0%) overhead = 1048576(100%) total
        

31.11.1. Samba Users Tools

The commands listed below are some that we use often, but many more exist. Check the man pages and documentation for more details and information.

smbclient. The smbclient program utility for Samba works much like the interface of the FTP program. This small program allow you to get files from the server to the local machine, put files from the local machine to the server, retrieve directory information from the server, and so on.

To connect to a Windows machine with smbclient utility, use the following command:


          [root@deep ] /# smbclient //sbmserver/sharename -U smbclient
          [root@deep ] /# smbclient //gate/tmp -U smbclient
        


          Password:
          Domain=[OPENNA] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0]
          smb: \> ls
          .                                     D       0       Tue Mar 14 15:31:50 2000
          ..                                    D       0       Tue Mar 14 15:31:50 2000
          PostgreSQL                            D       0       Tue Mar 14 15:32:22 2000
          Squid                                 D       0       Tue Mar 14 15:32:28 2000
          E_comm                                D       0       Tue Mar 14 15:32:42 2000
          StackGuard.pdf                        A       61440   Tue Dec 21 20:41:34 1999
          installation-without-XFree86          A       448     Tue Dec 21 20:41:28 1999
          lcap-0_0_3-2_src.rpm                  A       13481   Thu Jan 13 01:50:12 2000
          mirc561t.exe                          A       948224  Tue Dec 21 20:41:54 1999

          65510 blocks of size 32768. 5295 blocks available
          smb: \>
        
Where //sbmserver is the name of the server you want to connect to. /sharename is the directory on this server you want to connect to, and smbclient is your username on this machine.