source: branches/samba-3.3.x/docs/manpages/smbclient.1

Last change on this file was 411, checked in by Herwig Bauernfeind, 16 years ago

Update Samba 3.3.x to 3.3.11

File size: 43.5 KB
Line 
1.\" Title: smbclient
2.\" Author: [see the "AUTHOR" section]
3.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
4.\" Date: 02/22/2010
5.\" Manual: User Commands
6.\" Source: Samba 3.3
7.\" Language: English
8.\"
9.TH "SMBCLIENT" "1" "02/22/2010" "Samba 3\&.3" "User Commands"
10.\" -----------------------------------------------------------------
11.\" * (re)Define some macros
12.\" -----------------------------------------------------------------
13.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14.\" toupper - uppercase a string (locale-aware)
15.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16.de toupper
17.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
18\\$*
19.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
20..
21.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22.\" SH-xref - format a cross-reference to an SH section
23.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24.de SH-xref
25.ie n \{\
26.\}
27.toupper \\$*
28.el \{\
29\\$*
30.\}
31..
32.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33.\" SH - level-one heading that works better for non-TTY output
34.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35.de1 SH
36.\" put an extra blank line of space above the head in non-TTY output
37.if t \{\
38.sp 1
39.\}
40.sp \\n[PD]u
41.nr an-level 1
42.set-an-margin
43.nr an-prevailing-indent \\n[IN]
44.fi
45.in \\n[an-margin]u
46.ti 0
47.HTML-TAG ".NH \\n[an-level]"
48.it 1 an-trap
49.nr an-no-space-flag 1
50.nr an-break-flag 1
51\." make the size of the head bigger
52.ps +3
53.ft B
54.ne (2v + 1u)
55.ie n \{\
56.\" if n (TTY output), use uppercase
57.toupper \\$*
58.\}
59.el \{\
60.nr an-break-flag 0
61.\" if not n (not TTY), use normal case (not uppercase)
62\\$1
63.in \\n[an-margin]u
64.ti 0
65.\" if not n (not TTY), put a border/line under subheading
66.sp -.6
67\l'\n(.lu'
68.\}
69..
70.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71.\" SS - level-two heading that works better for non-TTY output
72.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73.de1 SS
74.sp \\n[PD]u
75.nr an-level 1
76.set-an-margin
77.nr an-prevailing-indent \\n[IN]
78.fi
79.in \\n[IN]u
80.ti \\n[SN]u
81.it 1 an-trap
82.nr an-no-space-flag 1
83.nr an-break-flag 1
84.ps \\n[PS-SS]u
85\." make the size of the head bigger
86.ps +2
87.ft B
88.ne (2v + 1u)
89.if \\n[.$] \&\\$*
90..
91.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92.\" BB/BE - put background/screen (filled box) around block of text
93.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94.de BB
95.if t \{\
96.sp -.5
97.br
98.in +2n
99.ll -2n
100.gcolor red
101.di BX
102.\}
103..
104.de EB
105.if t \{\
106.if "\\$2"adjust-for-leading-newline" \{\
107.sp -1
108.\}
109.br
110.di
111.in
112.ll
113.gcolor
114.nr BW \\n(.lu-\\n(.i
115.nr BH \\n(dn+.5v
116.ne \\n(BHu+.5v
117.ie "\\$2"adjust-for-leading-newline" \{\
118\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
119.\}
120.el \{\
121\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
122.\}
123.in 0
124.sp -.5v
125.nf
126.BX
127.in
128.sp .5v
129.fi
130.\}
131..
132.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133.\" BM/EM - put colored marker in margin next to block of text
134.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135.de BM
136.if t \{\
137.br
138.ll -2n
139.gcolor red
140.di BX
141.\}
142..
143.de EM
144.if t \{\
145.br
146.di
147.ll
148.gcolor
149.nr BH \\n(dn
150.ne \\n(BHu
151\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
152.in 0
153.nf
154.BX
155.in
156.fi
157.\}
158..
159.\" -----------------------------------------------------------------
160.\" * set default formatting
161.\" -----------------------------------------------------------------
162.\" disable hyphenation
163.nh
164.\" disable justification (adjust text to left margin only)
165.ad l
166.\" -----------------------------------------------------------------
167.\" * MAIN CONTENT STARTS HERE *
168.\" -----------------------------------------------------------------
169.SH "Name"
170smbclient \- ftp\-like client to access SMB/CIFS resources on servers
171.SH "Synopsis"
172.fam C
173.HP \w'\ 'u
174\FCsmbclient\F[] [\-b\ <buffer\ size>] [\-d\ debuglevel] [\-e] [\-L\ <netbios\ name>] [\-U\ username] [\-I\ destinationIP] [\-M\ <netbios\ name>] [\-m\ maxprotocol] [\-A\ authfile] [\-N] [\-g] [\-i\ scope] [\-O\ <socket\ options>] [\-p\ port] [\-R\ <name\ resolve\ order>] [\-s\ <smb\ config\ file>] [\-k] [\-P] [\-c\ <command>]
175.fam
176.fam C
177.HP \w'\ 'u
178\FCsmbclient\F[] {servicename} [password] [\-b\ <buffer\ size>] [\-d\ debuglevel] [\-e] [\-D\ Directory] [\-U\ username] [\-W\ workgroup] [\-M\ <netbios\ name>] [\-m\ maxprotocol] [\-A\ authfile] [\-N] [\-g] [\-l\ log\-basename] [\-I\ destinationIP] [\-E] [\-c\ <command\ string>] [\-i\ scope] [\-O\ <socket\ options>] [\-p\ port] [\-R\ <name\ resolve\ order>] [\-s\ <smb\ config\ file>] [\-T<c|x>IXFqgbNan] [\-k]
179.fam
180.SH "DESCRIPTION"
181.PP
182This tool is part of the
183\fBsamba\fR(7)
184suite\&.
185.PP
186\FCsmbclient\F[]
187is a client that can \'talk\' to an SMB/CIFS server\&. It offers an interface similar to that of the ftp program (see
188\fBftp\fR(1))\&. Operations include things like getting files from the server to the local machine, putting files from the local machine to the server, retrieving directory information from the server and so on\&.
189.SH "OPTIONS"
190.PP
191servicename
192.RS 4
193servicename is the name of the service you want to use on the server\&. A service name takes the form
194\FC//server/service\F[]
195where
196\fIserver \fR
197is the NetBIOS name of the SMB/CIFS server offering the desired service and
198\fIservice\fR
199is the name of the service offered\&. Thus to connect to the service "printer" on the SMB/CIFS server "smbserver", you would use the servicename
200\FC//smbserver/printer \F[]
201.sp
202Note that the server name required is NOT necessarily the IP (DNS) host name of the server ! The name required is a NetBIOS server name, which may or may not be the same as the IP hostname of the machine running the server\&.
203.sp
204The server name is looked up according to either the
205\fI\-R\fR
206parameter to
207\FCsmbclient\F[]
208or using the name resolve order parameter in the
209\fBsmb.conf\fR(5)
210file, allowing an administrator to change the order and methods by which server names are looked up\&.
211.RE
212.PP
213password
214.RS 4
215The password required to access the specified service on the specified server\&. If this parameter is supplied, the
216\fI\-N\fR
217option (suppress password prompt) is assumed\&.
218.sp
219There is no default password\&. If no password is supplied on the command line (either by using this parameter or adding a password to the
220\fI\-U\fR
221option (see below)) and the
222\fI\-N\fR
223option is not specified, the client will prompt for a password, even if the desired service does not require one\&. (If no password is required, simply press ENTER to provide a null password\&.)
224.sp
225Note: Some servers (including OS/2 and Windows for Workgroups) insist on an uppercase password\&. Lowercase or mixed case passwords may be rejected by these servers\&.
226.sp
227Be cautious about including passwords in scripts\&.
228.RE
229.PP
230\-R <name resolve order>
231.RS 4
232This option is used by the programs in the Samba suite to determine what naming services and in what order to resolve host names to IP addresses\&. The option takes a space\-separated string of different name resolution options\&.
233.sp
234The options are :"lmhosts", "host", "wins" and "bcast"\&. They cause names to be resolved as follows:
235.sp
236.RS 4
237.ie n \{\
238\h'-04'\(bu\h'+03'\c
239.\}
240.el \{\
241.sp -1
242.IP \(bu 2.3
243.\}
244\fBlmhosts\fR: Lookup an IP address in the Samba lmhosts file\&. If the line in lmhosts has no name type attached to the NetBIOS name (see the
245\fBlmhosts\fR(5)
246for details) then any name type matches for lookup\&.
247.RE
248.sp
249.RS 4
250.ie n \{\
251\h'-04'\(bu\h'+03'\c
252.\}
253.el \{\
254.sp -1
255.IP \(bu 2.3
256.\}
257\fBhost\fR: Do a standard host name to IP address resolution, using the system
258\FC/etc/hosts \F[], NIS, or DNS lookups\&. This method of name resolution is operating system dependent, for instance on IRIX or Solaris this may be controlled by the
259\FC/etc/nsswitch\&.conf\F[]
260file)\&. Note that this method is only used if the NetBIOS name type being queried is the 0x20 (server) name type, otherwise it is ignored\&.
261.RE
262.sp
263.RS 4
264.ie n \{\
265\h'-04'\(bu\h'+03'\c
266.\}
267.el \{\
268.sp -1
269.IP \(bu 2.3
270.\}
271\fBwins\fR: Query a name with the IP address listed in the
272\fIwins server\fR
273parameter\&. If no WINS server has been specified this method will be ignored\&.
274.RE
275.sp
276.RS 4
277.ie n \{\
278\h'-04'\(bu\h'+03'\c
279.\}
280.el \{\
281.sp -1
282.IP \(bu 2.3
283.\}
284\fBbcast\fR: Do a broadcast on each of the known local interfaces listed in the
285\fIinterfaces\fR
286parameter\&. This is the least reliable of the name resolution methods as it depends on the target host being on a locally connected subnet\&.
287.sp
288.RE
289If this parameter is not set then the name resolve order defined in the
290\fBsmb.conf\fR(5)
291file parameter (name resolve order) will be used\&.
292.sp
293The default order is lmhosts, host, wins, bcast and without this parameter or any entry in the
294\fIname resolve order \fR
295parameter of the
296\fBsmb.conf\fR(5)
297file the name resolution methods will be attempted in this order\&.
298.RE
299.PP
300\-M NetBIOS name
301.RS 4
302This options allows you to send messages, using the "WinPopup" protocol, to another computer\&. Once a connection is established you then type your message, pressing ^D (control\-D) to end\&.
303.sp
304If the receiving computer is running WinPopup the user will receive the message and probably a beep\&. If they are not running WinPopup the message will be lost, and no error message will occur\&.
305.sp
306The message is also automatically truncated if the message is over 1600 bytes, as this is the limit of the protocol\&.
307.sp
308One useful trick is to pipe the message through
309\FCsmbclient\F[]\&. For example: smbclient \-M FRED < mymessage\&.txt will send the message in the file
310\FCmymessage\&.txt\F[]
311to the machine FRED\&.
312.sp
313You may also find the
314\fI\-U\fR
315and
316\fI\-I\fR
317options useful, as they allow you to control the FROM and TO parts of the message\&.
318.sp
319See the
320\fImessage command\fR
321parameter in the
322\fBsmb.conf\fR(5)
323for a description of how to handle incoming WinPopup messages in Samba\&.
324.sp
325\fINote\fR: Copy WinPopup into the startup group on your WfWg PCs if you want them to always be able to receive messages\&.
326.RE
327.PP
328\-p port
329.RS 4
330This number is the TCP port number that will be used when making connections to the server\&. The standard (well\-known) TCP port number for an SMB/CIFS server is 139, which is the default\&.
331.RE
332.PP
333\-g
334.RS 4
335This parameter provides combined with
336\fI\-L\fR
337easy parseable output that allows processing with utilities such as grep and cut\&.
338.RE
339.PP
340\-P
341.RS 4
342Make queries to the external server using the machine account of the local server\&.
343.RE
344.PP
345\-h|\-\-help
346.RS 4
347Print a summary of command line options\&.
348.RE
349.PP
350\-I IP\-address
351.RS 4
352\fIIP address\fR
353is the address of the server to connect to\&. It should be specified in standard "a\&.b\&.c\&.d" notation\&.
354.sp
355Normally the client would attempt to locate a named SMB/CIFS server by looking it up via the NetBIOS name resolution mechanism described above in the
356\fIname resolve order\fR
357parameter above\&. Using this parameter will force the client to assume that the server is on the machine with the specified IP address and the NetBIOS name component of the resource being connected to will be ignored\&.
358.sp
359There is no default for this parameter\&. If not supplied, it will be determined automatically by the client as described above\&.
360.RE
361.PP
362\-E
363.RS 4
364This parameter causes the client to write messages to the standard error stream (stderr) rather than to the standard output stream\&.
365.sp
366By default, the client writes messages to standard output \- typically the user\'s tty\&.
367.RE
368.PP
369\-L
370.RS 4
371This option allows you to look at what services are available on a server\&. You use it as
372\FCsmbclient \-L host\F[]
373and a list should appear\&. The
374\fI\-I \fR
375option may be useful if your NetBIOS names don\'t match your TCP/IP DNS host names or if you are trying to reach a host on another network\&.
376.RE
377.PP
378\-t terminal code
379.RS 4
380This option tells
381\FCsmbclient\F[]
382how to interpret filenames coming from the remote server\&. Usually Asian language multibyte UNIX implementations use different character sets than SMB/CIFS servers (\fIEUC\fR
383instead of
384\fI SJIS\fR
385for example)\&. Setting this parameter will let
386\FCsmbclient\F[]
387convert between the UNIX filenames and the SMB filenames correctly\&. This option has not been seriously tested and may have some problems\&.
388.sp
389The terminal codes include CWsjis, CWeuc, CWjis7, CWjis8, CWjunet, CWhex, CWcap\&. This is not a complete list, check the Samba source code for the complete list\&.
390.RE
391.PP
392\-b buffersize
393.RS 4
394This option changes the transmit/send buffer size when getting or putting a file from/to the server\&. The default is 65520 bytes\&. Setting this value smaller (to 1200 bytes) has been observed to speed up file transfers to and from a Win9x server\&.
395.RE
396.PP
397\-e
398.RS 4
399This command line parameter requires the remote server support the UNIX extensions\&. Request that the connection be encrypted\&. This is new for Samba 3\&.2 and will only work with Samba 3\&.2 or above servers\&. Negotiates SMB encryption using GSSAPI\&. Uses the given credentials for the encryption negotiaion (either kerberos or NTLMv1/v2 if given domain/username/password triple\&. Fails the connection if encryption cannot be negotiated\&.
400.RE
401.PP
402\-d|\-\-debuglevel=level
403.RS 4
404\fIlevel\fR
405is an integer from 0 to 10\&. The default value if this parameter is not specified is 1\&.
406.sp
407The higher this value, the more detail will be logged to the log files about the activities of the server\&. At level 0, only critical errors and serious warnings will be logged\&. Level 1 is a reasonable level for day\-to\-day running \- it generates a small amount of information about operations carried out\&.
408.sp
409Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem\&. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic\&.
410.sp
411Note that specifying this parameter here will override the
412\m[blue]\fB\%smb.conf.5.html#\fR\m[]
413parameter in the
414\FCsmb\&.conf\F[]
415file\&.
416.RE
417.PP
418\-V|\-\-version
419.RS 4
420Prints the program version number\&.
421.RE
422.PP
423\-s|\-\-configfile <configuration file>
424.RS 4
425The file specified contains the configuration details required by the server\&. The information in this file includes server\-specific information such as what printcap file to use, as well as descriptions of all the services that the server is to provide\&. See
426\FCsmb\&.conf\F[]
427for more information\&. The default configuration file name is determined at compile time\&.
428.RE
429.PP
430\-l|\-\-log\-basename=logdirectory
431.RS 4
432Base directory name for log/debug files\&. The extension
433\fB"\&.progname"\fR
434will be appended (e\&.g\&. log\&.smbclient, log\&.smbd, etc\&.\&.\&.)\&. The log file is never removed by the client\&.
435.RE
436.PP
437\-N|\-\-no\-pass
438.RS 4
439If specified, this parameter suppresses the normal password prompt from the client to the user\&. This is useful when accessing a service that does not require a password\&.
440.sp
441Unless a password is specified on the command line or this parameter is specified, the client will request a password\&.
442.sp
443If a password is specified on the command line and this option is also defined the password on the command line will be silently ingnored and no password will be used\&.
444.RE
445.PP
446\-k|\-\-kerberos
447.RS 4
448Try to authenticate with kerberos\&. Only useful in an Active Directory environment\&.
449.RE
450.PP
451\-C|\-\-use\-ccache
452.RS 4
453Try to use the credentials cached by winbind\&.
454.RE
455.PP
456\-A|\-\-authentication\-file=filename
457.RS 4