Listing Shares

Listing Shares

Now that you've identified a machine, how can you find out what shares it has? This task, and most others associated with Windows networking, can be done with the smbclient program, which is part of the standard Samba distribution. The syntax for listing shares is:

$ smbclient -L HOMER
added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
Password:
Anonymous login successful
Domain=[CURTIS] OS=[Unix] Server=[Samba 2.0.7]
 
Sharename Type Comment
--------- ---- -------
site-local Disk
c Disk Old Windows 95 Installation
IPC$ IPC IPC Service (homer server (Samba 2.0.7))
lp Printer HP Deskjet 672C
 
Server Comment
------ -------
HOMER homer server (Samba 2.0.7)
KEARNEY Tom's Computer
SANJAY Annie's Computer
Workgroup Master
--------- ------
CURTIS HOMER

This is actually a lot more information than you might have expected ”but we'll go through it one piece at a time. I just hit Enter at the password prompt for an anonymous login. There are a few messages at first, and then the first table, which shows the shares available on HOMER, their type, and any comment that's set up in the configuration file. The second table lists the machines in the current workgroup along with their descriptions. This answers our question in the previous section, about how to find the machines on the local network. The third table describes the available workgroups and which machines are the master browsers for each. In my case, there's only one workgroup.

Now if I looked at the shares on KEARNEY, I'd get a different result:

$ smbclient -L KEARNEY
added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
Password:
Anonymous login successful
Sharename Type Comment
--------- ---- -------
CDROM Disk
PRINTER$ Disk
CANON Printer
ZIPLIB Disk
IPC$ IPC Remote Inter Process Communication

If I want to specify a different workgroup or a username (in the case of Windows NT domains), I could use the -W and -U options to smbclient, respectively.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net