Dancing the SAMBA: An Introduction to Living with Windows

Samba as an FTP Client

The most basic use of SAMBA as a client is using smbclient which lets you browse and connect to shares on remote machines. Note that SAMBA uses forward slashes (/) instead of the non-standard backslashes(\) used by some other operating system/

The -L flag lists available shares on the server (including "hidden" shares  that end with $):

[alon@localhost]$ smbclient -L //server
Password:
Anonymous login successful
Domain=[ALTMAN] OS=[Unix] Server=[Samba 3.0.8-Debian]

Sharename Type Comment
--------- ---- -------
print$ Disk
docs Disk Linux Documentation
public Disk Public Stuff
morespace Disk More Space
music Disk Music
hp Printer
IPC$ IPC IPC Service (Main Altman server)
ADMIN$ IPC IPC Service (Main Altman server)

To connect to a share simply type smbclient sharename. If login is required, specify a user with the -U switch.

[alon@localhost]$ smbclient //server/docs
Password:
Anonymous login successful
Domain=[ALTMAN] OS=[Unix] Server=[Samba 3.0.8-Debian]
smb: \>
smb: \> ls
. D 0 Thu Jan 20 00:32:43 2005
.. D 0 Mon Dec 27 08:15:43 2004
base-files D 0 Sun Nov 14 00:46:48 2004
base-passwd D 0 Wed Sep 15 17:07:30 2004
... snipped ...
latex-beamer D 0 Thu Jan 20 00:32:43 2005
pgf D 0 Thu Jan 20 00:32:43 2005

37078 blocks of size 2097152. 1482 blocks available
smb: \>

smbclient recognizes standard FTP commands such as get and put.

Valid HTML 4.01!Alon Altman