smbclient is very similar to ftp, you connect to a machine and then browse the remote file system and download or upload files. Unlike ftp you must know what service you want before you connect to the machine.
You can find out what shares are available by using the '-L hostname' option to list the shares. When connecting to my unix box the smbclient shows the following:
I have an internal network not connected to the internet called clubs.uk with machines named after Liverpool clubs.
*smbclient -L voodoo.clubs.uk myhostname is (wildlife.clubs.uk) login name is WILDLIFE Server time is Thu Jul 3 19:54:42 1997 Timezone is UTC+1.0 Domain=[CLUBBERS] OS=[Unix] Server=[Samba 1.9.15p8] login appeared to be ok Server=[voodoo] User=[simon] Workgroup=[CLUBBERS] Domain=[CLUBBERS] server info completed Sharename Type Comment --------- ---- ------- IPC$ IPC IPC Service (Samba 1.9.15p8) lp Printer local line printer ps_hi Printer Ghostscript (epson9high) ps_lo Printer Ghostscript (epson) public Disk Public file space simon Disk Home Directories www Disk WWW work space This machine has a browse list: Server Comment --------- ------- VOODOO Samba 1.9.15p8 EASYSTREET UNIT Ben Rayner CREAM Aaaargh..... GARLANDS CHARLES MASSEY
instead of the normal:
smbclient \\VOODOO\public
which you would find in the man page included in this archive.
when prompted for a password for a public directory just press enter.
when you connect you will be prompted with the root of this share. you can now move about it using 'cd', view directory listings with 'ls' or 'dir' and move files about just like ftp.
I've had transfer rates of almost 400k/sec for large file transfers in a taskwindow on my StrongARM RiscPC from my PC with it's old ISA network card.
You can help it a lot by giving it some hints as to who you want to login as. the following environment variables can be set:
Set USER simon
Set LOGNAME simon
These do not need to be the same, in the above example I didn't set LOGNAME
which defaulted to the hostname of the machine I was connecting from.
The system variable Inet$HostName must be setup, it should be if your connecting over a network.
Set PAGER more
can be used to display a file, note that more is the default program it
will try to run.
early versions would crash at the end of small transfers that took less than a centisecond to complete. This problem was present in the original sources and was caused by a divide by zero.
bug reports and text dumps of sessions should be sent to me via email as should requests for my current address.
mail to simon@bigblue.........
This port of smbclient has only been lightly tested.
login and password checking looks ok as does get and put for disks
and put for printers. sending popup messages also works.
This program was tested on a unix server running samba and several
Win95 machines.
Simon Truss
December 1999
latest version of this document smbclient.html