The Samba Team supplies smbclient
as a basic part of the Samba suite. At
first, it might seem to be a primitive interface to the SMB network,
but smbclient is actually a versatile tool. It
can be used for browsing shares on servers, testing configurations,
debugging, accessing shared printers, backing up shared data, and
automating administrative tasks in shell scripts. And unlike
smbclient works on all Unix variants that
In this chapter we’ll focus mostly on running smbclient as an interactive shell, using its ftp-like commands to access shared directories on the network. Using smbclient to access printers and perform backups will be covered in Chapter 10.
A complete reference to smbclient is found in Appendix C.
The -L option can be used with smbclient to list the resources on a single computer. Assuming the Samba server is configured to take the role of the master browser, we can obtain a list of the computers in the domain or workgroup like this:
smbclient -L toltecadded interface ip=172.16.1.1 bcast=172.16.1.255 nmask=255.255.255.0 Password: Domain=[METRAN] OS=[Unix] Server=[Samba 2.2.5] Sharename Type Comment --------- ---- ------- test Disk For testing only, please IPC$ IPC IPC Service (Samba 2.2.5) ADMIN$ Disk IPC Service (Samba 2.2.5) Server Comment --------- ------- MAYA Windows 98 MIXTEC Samba 2.2.5 TOLTEC Samba 2.2.5 ZAPOTEC Workgroup Master --------- ------- METRAN TOLTEC
In the column labeled “Server”,