source: vendor/3.6.0/docs/manpages/smbclient.1

Last change on this file was 740, checked in by Silvan Scherrer, 13 years ago

Samba Server: update vendor to 3.6.0

File size: 39.6 KB
Line 
1'\" t
2.\" Title: smbclient
3.\" Author: [see the "AUTHOR" section]
4.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5.\" Date: 08/08/2011
6.\" Manual: User Commands
7.\" Source: Samba 3.6
8.\" Language: English
9.\"
10.TH "SMBCLIENT" "1" "08/08/2011" "Samba 3\&.6" "User Commands"
11.\" -----------------------------------------------------------------
12.\" * set default formatting
13.\" -----------------------------------------------------------------
14.\" disable hyphenation
15.nh
16.\" disable justification (adjust text to left margin only)
17.ad l
18.\" -----------------------------------------------------------------
19.\" * MAIN CONTENT STARTS HERE *
20.\" -----------------------------------------------------------------
21.SH "NAME"
22smbclient \- ftp\-like client to access SMB/CIFS resources on servers
23.SH "SYNOPSIS"
24.HP \w'\ 'u
25smbclient [\-b\ <buffer\ size>] [\-d\ debuglevel] [\-e] [\-L\ <netbios\ name>] [\-U\ username] [\-I\ destinationIP] [\-M\ <netbios\ name>] [\-m\ maxprotocol] [\-A\ authfile] [\-N] [\-C] [\-g] [\-i\ scope] [\-O\ <socket\ options>] [\-p\ port] [\-R\ <name\ resolve\ order>] [\-s\ <smb\ config\ file>] [\-k] [\-P] [\-c\ <command>]
26.HP \w'\ 'u
27smbclient {servicename} [password] [\-b\ <buffer\ size>] [\-d\ debuglevel] [\-e] [\-D\ Directory] [\-U\ username] [\-W\ workgroup] [\-M\ <netbios\ name>] [\-m\ maxprotocol] [\-A\ authfile] [\-N] [\-C] [\-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]
28.SH "DESCRIPTION"
29.PP
30This tool is part of the
31\fBsamba\fR(7)
32suite\&.
33.PP
34smbclient
35is a client that can \'talk\' to an SMB/CIFS server\&. It offers an interface similar to that of the ftp program (see
36\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\&.
37.SH "OPTIONS"
38.PP
39servicename
40.RS 4
41servicename is the name of the service you want to use on the server\&. A service name takes the form
42//server/service
43where
44\fIserver \fR
45is the NetBIOS name of the SMB/CIFS server offering the desired service and
46\fIservice\fR
47is the name of the service offered\&. Thus to connect to the service "printer" on the SMB/CIFS server "smbserver", you would use the servicename
48//smbserver/printer
49.sp
50Note 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\&.
51.sp
52The server name is looked up according to either the
53\fI\-R\fR
54parameter to
55smbclient
56or using the name resolve order parameter in the
57\fBsmb.conf\fR(5)
58file, allowing an administrator to change the order and methods by which server names are looked up\&.
59.RE
60.PP
61password
62.RS 4
63The password required to access the specified service on the specified server\&. If this parameter is supplied, the
64\fI\-N\fR
65option (suppress password prompt) is assumed\&.
66.sp
67There is no default password\&. If no password is supplied on the command line (either by using this parameter or adding a password to the
68\fI\-U\fR
69option (see below)) and the
70\fI\-N\fR
71option 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\&.)
72.sp
73Note: 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\&.
74.sp
75Be cautious about including passwords in scripts\&.
76.RE
77.PP
78\-R|\-\-name\-resolve <name resolve order>
79.RS 4
80This 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\&.
81.sp
82The options are :"lmhosts", "host", "wins" and "bcast"\&. They cause names to be resolved as follows:
83.sp
84.RS 4
85.ie n \{\
86\h'-04'\(bu\h'+03'\c
87.\}
88.el \{\
89.sp -1
90.IP \(bu 2.3
91.\}
92\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
93\fBlmhosts\fR(5)
94for details) then any name type matches for lookup\&.
95.RE
96.sp
97.RS 4
98.ie n \{\
99\h'-04'\(bu\h'+03'\c
100.\}
101.el \{\
102.sp -1
103.IP \(bu 2.3
104.\}
105\fBhost\fR: Do a standard host name to IP address resolution, using the system
106/etc/hosts, 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
107/etc/nsswitch\&.conf
108file)\&. Note that this method is only used if the NetBIOS name type being queried is the 0x20 (server) name type, otherwise it is ignored\&.
109.RE
110.sp
111.RS 4
112.ie n \{\
113\h'-04'\(bu\h'+03'\c
114.\}
115.el \{\
116.sp -1
117.IP \(bu 2.3
118.\}
119\fBwins\fR: Query a name with the IP address listed in the
120\fIwins server\fR
121parameter\&. If no WINS server has been specified this method will be ignored\&.
122.RE
123.sp
124.RS 4
125.ie n \{\
126\h'-04'\(bu\h'+03'\c
127.\}
128.el \{\
129.sp -1
130.IP \(bu 2.3
131.\}
132\fBbcast\fR: Do a broadcast on each of the known local interfaces listed in the
133\fIinterfaces\fR
134parameter\&. This is the least reliable of the name resolution methods as it depends on the target host being on a locally connected subnet\&.
135.RE
136.sp
137.RE
138If this parameter is not set then the name resolve order defined in the
139\fBsmb.conf\fR(5)
140file parameter (name resolve order) will be used\&.
141.sp
142The default order is lmhosts, host, wins, bcast and without this parameter or any entry in the
143\fIname resolve order \fR
144parameter of the
145\fBsmb.conf\fR(5)
146file the name resolution methods will be attempted in this order\&.
147.RE
148.PP
149\-M|\-\-message NetBIOS name
150.RS 4
151This 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\&.
152.sp
153If 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\&.
154.sp
155The message is also automatically truncated if the message is over 1600 bytes, as this is the limit of the protocol\&.
156.sp
157One useful trick is to pipe the message through
158smbclient\&. For example: smbclient \-M FRED < mymessage\&.txt will send the message in the file
159mymessage\&.txt
160to the machine FRED\&.
161.sp
162You may also find the
163\fI\-U\fR
164and
165\fI\-I\fR
166options useful, as they allow you to control the FROM and TO parts of the message\&.
167.sp
168See the
169\fImessage command\fR
170parameter in the
171\fBsmb.conf\fR(5)
172for a description of how to handle incoming WinPopup messages in Samba\&.
173.sp
174\fINote\fR: Copy WinPopup into the startup group on your WfWg PCs if you want them to always be able to receive messages\&.
175.RE
176.PP
177\-p|\-\-port port
178.RS 4
179This 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\&.
180.RE
181.PP
182\-g|\-\-grepable
183.RS 4
184This parameter provides combined with
185\fI\-L\fR
186easy parseable output that allows processing with utilities such as grep and cut\&.
187.RE
188.PP
189\-m|\-\-max\-protocol protocol
190.RS 4
191This parameter sets the maximum protocol version announced by the client\&.
192.RE
193.PP
194\-P|\-\-machine\-pass
195.RS 4
196Make queries to the external server using the machine account of the local server\&.
197.RE
198.PP
199\-h|\-\-help
200.RS 4
201Print a summary of command line options\&.
202.RE
203.PP
204\-I|\-\-ip\-address IP\-address
205.RS 4
206\fIIP address\fR
207is the address of the server to connect to\&. It should be specified in standard "a\&.b\&.c\&.d" notation\&.
208.sp
209Normally 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
210\fIname resolve order\fR
211parameter 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\&.
212.sp
213There is no default for this parameter\&. If not supplied, it will be determined automatically by the client as described above\&.
214.RE
215.PP
216\-E|\-\-stderr
217.RS 4
218This parameter causes the client to write messages to the standard error stream (stderr) rather than to the standard output stream\&.
219.sp
220By default, the client writes messages to standard output \- typically the user\'s tty\&.
221.RE
222.PP
223\-L|\-\-list
224.RS 4
225This option allows you to look at what services are available on a server\&. You use it as
226smbclient \-L host
227and a list should appear\&. The
228\fI\-I \fR
229option 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\&.
230.RE
231.PP
232\-b|\-\-send\-buffer buffersize
233.RS 4
234This 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\&.
235.RE
236.PP
237\-e|\-\-encrypt
238.RS 4
239This 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\&.
240.RE
241.PP
242\-d|\-\-debuglevel=level
243.RS 4
244\fIlevel\fR
245is an integer from 0 to 10\&. The default value if this parameter is not specified is 1\&.
246.sp
247The 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\&.
248.sp
249Levels 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\&.
250.sp
251Note that specifying this parameter here will override the
252\m[blue]\fB\%smb.conf.5.html#\fR\m[]
253parameter in the
254smb\&.conf
255file\&.
256.RE
257.PP
258\-V|\-\-version
259.RS 4
260Prints the program version number\&.
261.RE
262.PP
263\-s|\-\-configfile <configuration file>
264.RS 4
265The 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
266smb\&.conf
267for more information\&. The default configuration file name is determined at compile time\&.
268.RE
269.PP
270\-l|\-\-log\-basename=logdirectory
271.RS 4
272Base directory name for log/debug files\&. The extension
273\fB"\&.progname"\fR
274will be appended (e\&.g\&. log\&.smbclient, log\&.smbd, etc\&.\&.\&.)\&. The log file is never removed by the client\&.
275.RE
276.PP
277\-N|\-\-no\-pass
278.RS 4
279If 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\&.
280.sp
281Unless a password is specified on the command line or this parameter is specified, the client will request a password\&.
282.sp
283If 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\&.
284.RE
285.PP
286\-k|\-\-kerberos
287.RS 4
288Try to authenticate with kerberos\&. Only useful in an Active Directory environment\&.
289.RE
290.PP
291\-C|\-\-use\-ccache
292.RS 4
293Try to use the credentials cached by winbind\&.
294.RE
295.PP
296\-A|\-\-authentication\-file=filename
297.RS 4
298This option allows you to specify a file from which to read the username and password used in the connection\&. The format of the file is
299.sp
300.if n \{\
301.RS 4
302.\}
303.nf
304username = <value>
305password = <value>
306domain = <value>
307.fi
308.if n \{\
309.RE
310.\}
311.sp
312Make certain that the permissions on the file restrict access from unwanted users\&.
313.RE
314.PP
315\-U|\-\-user=username[%password]
316.RS 4
317Sets the SMB username or username and password\&.
318.sp
319If %password is not specified, the user will be prompted\&. The client will first check the
320\fBUSER\fR
321environment variable, then the
322\fBLOGNAME\fR
323variable and if either exists, the string is uppercased\&. If these environmental variables are not found, the username
324\fBGUEST\fR
325is used\&.
326.sp
327A third option is to use a credentials file which contains the plaintext of the username and password\&. This option is mainly provided for scripts where the admin does not wish to pass the credentials on the command line or via environment variables\&. If this method is used, make certain that the permissions on the file restrict access from unwanted users\&. See the
328\fI\-A\fR
329for more details\&.
330.sp
331Be cautious about including passwords in scripts\&. Also, on many systems the command line of a running process may be seen via the
332ps
333command\&. To be safe always allow
334rpcclient
335to prompt for a password and type it in directly\&.
336.RE
337.PP
338\-n|\-\-netbiosname <primary NetBIOS name>
339.RS 4
340This option allows you to override the NetBIOS name that Samba uses for itself\&. This is identical to setting the
341\m[blue]\fB\%smb.conf.5.html#\fR\m[]
342parameter in the
343smb\&.conf
344file\&. However, a command line setting will take precedence over settings in
345smb\&.conf\&.
346.RE
347.PP
348\-i|\-\-scope <scope>
349.RS 4
350This specifies a NetBIOS scope that
351nmblookup
352will use to communicate with when generating NetBIOS names\&. For details on the use of NetBIOS scopes, see rfc1001\&.txt and rfc1002\&.txt\&. NetBIOS scopes are
353\fIvery\fR
354rarely used, only set this parameter if you are the system administrator in charge of all the NetBIOS systems you communicate with\&.
355.RE
356.PP
357\-W|\-\-workgroup=domain
358.RS 4
359Set the SMB domain of the username\&. This overrides the default domain which is the domain defined in smb\&.conf\&. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM)\&.
360.RE
361.PP
362\-O|\-\-socket\-options socket options
363.RS 4
364TCP socket options to set on the client socket\&. See the socket options parameter in the
365smb\&.conf
366manual page for the list of valid options\&.
367.RE
368.PP
369\-T|\-\-tar tar options
370.RS 4
371smbclient may be used to create
372tar(1)
373compatible backups of all the files on an SMB/CIFS share\&. The secondary tar flags that can be given to this option are :
374.sp
375.RS 4
376.ie n \{\
377\h'-04'\(bu\h'+03'\c
378.\}
379.el \{\
380.sp -1
381.IP \(bu 2.3
382.\}
383\fIc\fR
384\- Create a tar file on UNIX\&. Must be followed by the name of a tar file, tape device or "\-" for standard output\&. If using standard output you must turn the log level to its lowest value \-d0 to avoid corrupting your tar file\&. This flag is mutually exclusive with the
385\fIx\fR
386flag\&.
387.RE
388.sp
389.RS 4
390.ie n \{\
391\h'-04'\(bu\h'+03'\c
392.\}
393.el \{\
394.sp -1
395.IP \(bu 2.3
396.\}
397\fIx\fR
398\- Extract (restore) a local tar file back to a share\&. Unless the \-D option is given, the tar files will be restored from the top level of the share\&. Must be followed by the name of the tar file, device or "\-" for standard input\&. Mutually exclusive with the
399\fIc\fR
400flag\&. Restored files have their creation times (mtime) set to the date saved in the tar file\&. Directories currently do not get their creation dates restored properly\&.
401.RE
402.sp
403.RS 4
404.ie n \{\
405\h'-04'\(bu\h'+03'\c
406.\}
407.el \{\
408.sp -1
409.IP \(bu 2.3
410.\}
411\fII\fR
412\- Include files and directories\&. Is the default behavior when filenames are specified above\&. Causes files to be included in an extract or create (and therefore everything else to be excluded)\&. See example below\&. Filename globbing works in one of two ways\&. See
413\fIr\fR
414below\&.
415.RE
416.sp
417.RS 4
418.ie n \{\
419\h'-04'\(bu\h'+03'\c
420.\}
421.el \{\
422.sp -1
423.IP \(bu 2.3
424.\}
425\fIX\fR
426\- Exclude files and directories\&. Causes files to be excluded from an extract or create\&. See example below\&. Filename globbing works in one of two ways now\&. See
427\fIr\fR
428below\&.
429.RE
430.sp
431.RS 4
432.ie n \{\
433\h'-04'\(bu\h'+03'\c
434.\}
435.el \{\
436.sp -1
437.IP \(bu 2.3
438.\}
439\fIF\fR
440\- File containing a list of files and directories\&. The
441\fIF\fR
442causes the name following the tarfile to create to be read as a filename that contains a list of files and directories to be included in an extract or create (and therefore everything else to be excluded)\&. See example below\&. Filename globbing works in one of two ways\&. See
443\fIr\fR
444below\&.
445.RE
446.sp
447.RS 4
448.ie n \{\
449\h'-04'\(bu\h'+03'\c
450.\}
451.el \{\
452.sp -1
453.IP \(bu 2.3
454.\}
455\fIb\fR
456\- Blocksize\&. Must be followed by a valid (greater than zero) blocksize\&. Causes tar file to be written out in blocksize*TBLOCK (usually 512 byte) blocks\&.
457.RE
458.sp
459.RS 4
460.ie n \{\
461\h'-04'\(bu\h'+03'\c
462.\}
463.el \{\
464.sp -1
465.IP \(bu 2.3
466.\}
467\fIg\fR
468\- Incremental\&. Only back up files that have the archive bit set\&. Useful only with the
469\fIc\fR
470flag\&.
471.RE
472.sp
473.RS 4
474.ie n \{\
475\h'-04'\(bu\h'+03'\c
476.\}
477.el \{\
478.sp -1
479.IP \(bu 2.3
480.\}
481\fIq\fR
482\- Quiet\&. Keeps tar from printing diagnostics as it works\&. This is the same as tarmode quiet\&.
483.RE
484.sp
485.RS 4
486.ie n \{\
487\h'-04'\(bu\h'+03'\c
488.\}
489.el \{\
490.sp -1
491.IP \(bu 2.3
492.\}
493\fIr\fR
494\- Regular expression include or exclude\&. Uses regular expression matching for excluding or excluding files if compiled with HAVE_REGEX_H\&. However this mode can be very slow\&. If not compiled with HAVE_REGEX_H, does a limited wildcard match on \'*\' and \'?\'\&.
495.RE
496.sp
497.RS 4
498.ie n \{\
499\h'-04'\(bu\h'+03'\c
500.\}
501.el \{\
502.sp -1
503.IP \(bu 2.3
504.\}
505\fIN\fR
506\- Newer than\&. Must be followed by the name of a file whose date is compared against files found on the share during a create\&. Only files newer than the file specified are backed up to the tar file\&. Useful only with the
507\fIc\fR
508flag\&.
509.RE
510.sp
511.RS 4
512.ie n \{\
513\h'-04'\(bu\h'+03'\c
514.\}
515.el \{\
516.sp -1
517.IP \(bu 2.3
518.\}
519\fIa\fR
520\- Set archive bit\&. Causes the archive bit to be reset when a file is backed up\&. Useful with the
521\fIg\fR
522and
523\fIc\fR
524flags\&.
525.RE
526.sp
527.RE
528\fITar Long File Names\fR
529.sp
530smbclient\'s tar option now supports long file names both on backup and restore\&. However, the full path name of the file must be less than 1024 bytes\&. Also, when a tar archive is created,
531smbclient\'s tar option places all files in the archive with relative names, not absolute names\&.
532.sp
533\fITar Filenames\fR
534.sp
535All file names can be given as DOS path names (with \'\e\e\' as the component separator) or as UNIX path names (with \'/\' as the component separator)\&.
536.sp
537\fIExamples\fR
538.sp
539Restore from tar file
540backup\&.tar
541into myshare on mypc (no password on share)\&.
542.sp
543smbclient //mypc/yshare "" \-N \-Tx backup\&.tar
544.sp
545Restore everything except
546users/docs
547.sp
548smbclient //mypc/myshare "" \-N \-TXx backup\&.tar users/docs
549.sp
550Create a tar file of the files beneath
551users/docs\&.
552.sp
553smbclient //mypc/myshare "" \-N \-Tc backup\&.tar users/docs
554.sp
555Create the same tar file as above, but now use a DOS path name\&.
556.sp
557smbclient //mypc/myshare "" \-N \-tc backup\&.tar users\eedocs
558.sp
559Create a tar file of the files listed in the file
560tarlist\&.
561.sp
562smbclient //mypc/myshare "" \-N \-TcF backup\&.tar tarlist
563.sp
564Create a tar file of all the files and directories in the share\&.
565.sp
566smbclient //mypc/myshare "" \-N \-Tc backup\&.tar *
567.RE
568.PP
569\-D|\-\-directory initial directory
570.RS 4
571Change to initial directory before starting\&. Probably only of any use with the tar \-T option\&.
572.RE
573.PP
574\-c|\-\-command command string
575.RS 4
576command string is a semicolon\-separated list of commands to be executed instead of prompting from stdin\&.
577\fI \-N\fR
578is implied by
579\fI\-c\fR\&.
580.sp
581This is particularly useful in scripts and for printing stdin to the server, e\&.g\&.
582\-c \'print \-\'\&.
583.RE
584.SH "OPERATIONS"
585.PP
586Once the client is running, the user is presented with a prompt :
587.PP
588smb:\e>
589.PP
590The backslash ("\e\e") indicates the current working directory on the server, and will change if the current working directory is changed\&.
591.PP
592The prompt indicates that the client is ready and waiting to carry out a user command\&. Each command is a single word, optionally followed by parameters specific to that command\&. Command and parameters are space\-delimited unless these notes specifically state otherwise\&. All commands are case\-insensitive\&. Parameters to commands may or may not be case sensitive, depending on the command\&.
593.PP
594You can specify file names which have spaces in them by quoting the name with double quotes, for example "a long file name"\&.
595.PP
596Parameters shown in square brackets (e\&.g\&., "[parameter]") are optional\&. If not given, the command will use suitable defaults\&. Parameters shown in angle brackets (e\&.g\&., "<parameter>") are required\&.
597.PP
598Note that all commands operating on the server are actually performed by issuing a request to the server\&. Thus the behavior may vary from server to server, depending on how the server was implemented\&.
599.PP
600The commands available are given here in alphabetical order\&.
601.PP
602? [command]
603.RS 4
604If
605\fIcommand\fR
606is specified, the ? command will display a brief informative message about the specified command\&. If no command is specified, a list of available commands will be displayed\&.
607.RE
608.PP
609! [shell command]
610.RS 4
611If
612\fIshell command\fR
613is specified, the ! command will execute a shell locally and run the specified shell command\&. If no command is specified, a local shell will be run\&.
614.RE
615.PP
616allinfo file
617.RS 4
618The client will request that the server return all known information about a file or directory (including streams)\&.
619.RE
620.PP
621altname file
622.RS 4
623The client will request that the server return the "alternate" name (the 8\&.3 name) for a file or directory\&.
624.RE
625.PP
626archive <number>
627.RS 4
628Sets the archive level when operating on files\&. 0 means ignore the archive bit, 1 means only operate on files with this bit set, 2 means only operate on files with this bit set and reset it after operation, 3 means operate on all files and reset it after operation\&. The default is 0\&.
629.RE
630.PP
631blocksize <number>
632.RS 4
633Sets the blocksize parameter for a tar operation\&. The default is 20\&. Causes tar file to be written out in blocksize*TBLOCK (normally 512 byte) units\&.
634.RE
635.PP
636cancel jobid0 [jobid1] \&.\&.\&. [jobidN]
637.RS 4
638The client will request that the server cancel the printjobs identified by the given numeric print job ids\&.
639.RE
640.PP
641case_sensitive
642.RS 4
643Toggles the setting of the flag in SMB packets that tells the server to treat filenames as case sensitive\&. Set to OFF by default (tells file server to treat filenames as case insensitive)\&. Only currently affects Samba 3\&.0\&.5 and above file servers with the case sensitive parameter set to auto in the smb\&.conf\&.
644.RE
645.PP
646cd <directory name>
647.RS 4
648If "directory name" is specified, the current working directory on the server will be changed to the directory specified\&. This operation will fail if for any reason the specified directory is inaccessible\&.
649.sp
650If no directory name is specified, the current working directory on the server will be reported\&.
651.RE
652.PP
653chmod file mode in octal
654.RS 4
655This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. The client requests that the server change the UNIX permissions to the given octal mode, in standard UNIX format\&.
656.RE
657.PP
658chown file uid gid
659.RS 4
660This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. The client requests that the server change the UNIX user and group ownership to the given decimal values\&. Note there is currently no way to remotely look up the UNIX uid and gid values for a given name\&. This may be addressed in future versions of the CIFS UNIX extensions\&.
661.RE
662.PP
663close <fileid>
664.RS 4
665Closes a file explicitly opened by the open command\&. Used for internal Samba testing purposes\&.
666.RE
667.PP
668del <mask>
669.RS 4
670The client will request that the server attempt to delete all files matching
671\fImask\fR
672from the current working directory on the server\&.
673.RE
674.PP
675dir <mask>
676.RS 4
677A list of the files matching
678\fImask\fR
679in the current working directory on the server will be retrieved from the server and displayed\&.
680.RE
681.PP
682du <filename>
683.RS 4
684Does a directory listing and then prints out the current disk useage and free space on a share\&.
685.RE
686.PP
687echo <number> <data>
688.RS 4
689Does an SMBecho request to ping the server\&. Used for internal Samba testing purposes\&.
690.RE
691.PP
692exit
693.RS 4
694Terminate the connection with the server and exit from the program\&.
695.RE
696.PP
697get <remote file name> [local file name]
698.RS 4
699Copy the file called
700remote file name
701from the server to the machine running the client\&. If specified, name the local copy
702local file name\&. Note that all transfers in
703smbclient
704are binary\&. See also the lowercase command\&.
705.RE
706.PP
707getfacl <filename>
708.RS 4
709Requires the server support the UNIX extensions\&. Requests and prints the POSIX ACL on a file\&.
710.RE
711.PP
712hardlink <src> <dest>
713.RS 4
714Creates a hardlink on the server using Windows CIFS semantics\&.
715.RE
716.PP
717help [command]
718.RS 4
719See the ? command above\&.
720.RE
721.PP
722history
723.RS 4
724Displays the command history\&.
725.RE
726.PP
727iosize <bytes>
728.RS 4
729When sending or receiving files, smbclient uses an internal memory buffer by default of size 64512 bytes\&. This command allows this size to be set to any range between 16384 (0x4000) bytes and 16776960 (0xFFFF00) bytes\&. Larger sizes may mean more efficient data transfer as smbclient will try and use the most efficient read and write calls for the connected server\&.
730.RE
731.PP
732lcd [directory name]
733.RS 4
734If
735\fIdirectory name\fR
736is specified, the current working directory on the local machine will be changed to the directory specified\&. This operation will fail if for any reason the specified directory is inaccessible\&.
737.sp
738If no directory name is specified, the name of the current working directory on the local machine will be reported\&.
739.RE
740.PP
741link target linkname
742.RS 4
743This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. The client requests that the server create a hard link between the linkname and target files\&. The linkname file must not exist\&.
744.RE
745.PP
746listconnect
747.RS 4
748Show the current connections held for DFS purposes\&.
749.RE
750.PP
751lock <filenum> <r|w> <hex\-start> <hex\-len>
752.RS 4
753This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. Tries to set a POSIX fcntl lock of the given type on the given range\&. Used for internal Samba testing purposes\&.
754.RE
755.PP
756logon <username> <password>
757.RS 4
758Establishes a new vuid for this session by logging on again\&. Replaces the current vuid\&. Prints out the new vuid\&. Used for internal Samba testing purposes\&.
759.RE
760.PP
761lowercase
762.RS 4
763Toggle lowercasing of filenames for the get and mget commands\&.
764.sp
765When lowercasing is toggled ON, local filenames are converted to lowercase when using the get and mget commands\&. This is often useful when copying (say) MSDOS files from a server, because lowercase filenames are the norm on UNIX systems\&.
766.RE
767.PP
768ls <mask>
769.RS 4
770See the dir command above\&.
771.RE
772.PP
773mask <mask>
774.RS 4
775This command allows the user to set up a mask which will be used during recursive operation of the mget and mput commands\&.
776.sp
777The masks specified to the mget and mput commands act as filters for directories rather than files when recursion is toggled ON\&.
778.sp
779The mask specified with the mask command is necessary to filter files within those directories\&. For example, if the mask specified in an mget command is "source*" and the mask specified with the mask command is "*\&.c" and recursion is toggled ON, the mget command will retrieve all files matching "*\&.c" in all directories below and including all directories matching "source*" in the current working directory\&.
780.sp
781Note that the value for mask defaults to blank (equivalent to "*") and remains so until the mask command is used to change it\&. It retains the most recently specified value indefinitely\&. To avoid unexpected results it would be wise to change the value of mask back to "*" after using the mget or mput commands\&.
782.RE
783.PP
784md <directory name>
785.RS 4
786See the mkdir command\&.
787.RE
788.PP
789mget <mask>
790.RS 4
791Copy all files matching
792\fImask\fR
793from the server to the machine running the client\&.
794.sp
795Note that
796\fImask\fR
797is interpreted differently during recursive operation and non\-recursive operation \- refer to the recurse and mask commands for more information\&. Note that all transfers in
798smbclient
799are binary\&. See also the lowercase command\&.
800.RE
801.PP
802mkdir <directory name>
803.RS 4
804Create a new directory on the server (user access privileges permitting) with the specified name\&.
805.RE
806.PP
807more <file name>
808.RS 4
809Fetch a remote file and view it with the contents of your PAGER environment variable\&.
810.RE
811.PP
812mput <mask>
813.RS 4
814Copy all files matching
815\fImask\fR
816in the current working directory on the local machine to the current working directory on the server\&.
817.sp
818Note that
819\fImask\fR
820is interpreted differently during recursive operation and non\-recursive operation \- refer to the recurse and mask commands for more information\&. Note that all transfers in
821smbclient
822are binary\&.
823.RE
824.PP
825posix
826.RS 4
827Query the remote server to see if it supports the CIFS UNIX extensions and prints out the list of capabilities supported\&. If so, turn on POSIX pathname processing and large file read/writes (if available),\&.
828.RE
829.PP
830posix_encrypt <domain> <username> <password>
831.RS 4
832This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. Attempt to negotiate SMB encryption on this connection\&. If smbclient connected with kerberos credentials (\-k) the arguments to this command are ignored and the kerberos credentials are used to negotiate GSSAPI signing and sealing instead\&. See also the \-e option to smbclient to force encryption on initial connection\&. This command is new with Samba 3\&.2\&.
833.RE
834.PP
835posix_open <filename> <octal mode>
836.RS 4
837This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. Opens a remote file using the CIFS UNIX extensions and prints a fileid\&. Used for internal Samba testing purposes\&.
838.RE
839.PP
840posix_mkdir <directoryname> <octal mode>
841.RS 4
842This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. Creates a remote directory using the CIFS UNIX extensions with the given mode\&.
843.RE
844.PP
845posix_rmdir <directoryname>
846.RS 4
847This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. Deletes a remote directory using the CIFS UNIX extensions\&.
848.RE
849.PP
850posix_unlink <filename>
851.RS 4
852This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. Deletes a remote file using the CIFS UNIX extensions\&.
853.RE
854.PP
855print <file name>
856.RS 4
857Print the specified file from the local machine through a printable service on the server\&.
858.RE
859.PP
860prompt
861.RS 4
862Toggle prompting for filenames during operation of the mget and mput commands\&.
863.sp
864When toggled ON, the user will be prompted to confirm the transfer of each file during these commands\&. When toggled OFF, all specified files will be transferred without prompting\&.
865.RE
866.PP
867put <local file name> [remote file name]
868.RS 4
869Copy the file called
870local file name
871from the machine running the client to the server\&. If specified, name the remote copy
872remote file name\&. Note that all transfers in
873smbclient
874are binary\&. See also the lowercase command\&.
875.RE
876.PP
877queue
878.RS 4
879Displays the print queue, showing the job id, name, size and current status\&.
880.RE
881.PP
882quit
883.RS 4
884See the exit command\&.
885.RE
886.PP
887readlink symlinkname
888.RS 4
889This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. Print the value of the symlink "symlinkname"\&.
890.RE
891.PP
892rd <directory name>
893.RS 4
894See the rmdir command\&.
895.RE
896.PP
897recurse
898.RS 4
899Toggle directory recursion for the commands mget and mput\&.
900.sp
901When toggled ON, these commands will process all directories in the source directory (i\&.e\&., the directory they are copying from ) and will recurse into any that match the mask specified to the command\&. Only files that match the mask specified using the mask command will be retrieved\&. See also the mask command\&.
902.sp
903When recursion is toggled OFF, only files from the current working directory on the source machine that match the mask specified to the mget or mput commands will be copied, and any mask specified using the mask command will be ignored\&.
904.RE
905.PP
906rename <old filename> <new filename>
907.RS 4
908Rename files in the current working directory on the server from
909\fIold filename\fR
910to
911\fInew filename\fR\&.
912.RE
913.PP
914rm <mask>
915.RS 4
916Remove all files matching
917\fImask\fR
918from the current working directory on the server\&.
919.RE
920.PP
921rmdir <directory name>
922.RS 4
923Remove the specified directory (user access privileges permitting) from the server\&.
924.RE
925.PP
926setmode <filename> <perm=[+|\e\-]rsha>
927.RS 4
928A version of the DOS attrib command to set file permissions\&. For example:
929.sp
930setmode myfile +r
931.sp
932would make myfile read only\&.
933.RE
934.PP
935showconnect
936.RS 4
937Show the currently active connection held for DFS purposes\&.
938.RE
939.PP
940stat file
941.RS 4
942This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. The client requests the UNIX basic info level and prints out the same info that the Linux stat command would about the file\&. This includes the size, blocks used on disk, file type, permissions, inode number, number of links and finally the three timestamps (access, modify and change)\&. If the file is a special file (symlink, character or block device, fifo or socket) then extra information may also be printed\&.
943.RE
944.PP
945symlink target linkname
946.RS 4
947This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. The client requests that the server create a symbolic hard link between the target and linkname files\&. The linkname file must not exist\&. Note that the server will not create a link to any path that lies outside the currently connected share\&. This is enforced by the Samba server\&.
948.RE
949.PP
950tar <c|x>[IXbgNa]
951.RS 4
952Performs a tar operation \- see the
953\fI\-T \fR
954command line option above\&. Behavior may be affected by the tarmode command (see below)\&. Using g (incremental) and N (newer) will affect tarmode settings\&. Note that using the "\-" option with tar x may not work \- use the command line option instead\&.
955.RE
956.PP
957blocksize <blocksize>
958.RS 4
959Blocksize\&. Must be followed by a valid (greater than zero) blocksize\&. Causes tar file to be written out in
960\fIblocksize\fR*TBLOCK (usually 512 byte) blocks\&.
961.RE
962.PP
963tarmode <full|inc|reset|noreset>
964.RS 4
965Changes tar\'s behavior with regard to archive bits\&. In full mode, tar will back up everything regardless of the archive bit setting (this is the default mode)\&. In incremental mode, tar will only back up files with the archive bit set\&. In reset mode, tar will reset the archive bit on all files it backs up (implies read/write share)\&.
966.RE
967.PP
968unlock <filenum> <hex\-start> <hex\-len>
969.RS 4
970This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. Tries to unlock a POSIX fcntl lock on the given range\&. Used for internal Samba testing purposes\&.
971.RE
972.PP
973volume
974.RS 4
975Prints the current volume name of the share\&.
976.RE
977.PP
978vuid <number>
979.RS 4
980Changes the currently used vuid in the protocol to the given arbitrary number\&. Without an argument prints out the current vuid being used\&. Used for internal Samba testing purposes\&.
981.RE
982.SH "NOTES"
983.PP
984Some servers are fussy about the case of supplied usernames, passwords, share names (AKA service names) and machine names\&. If you fail to connect try giving all parameters in uppercase\&.
985.PP
986It is often necessary to use the \-n option when connecting to some types of servers\&. For example OS/2 LanManager insists on a valid NetBIOS name being used, so you need to supply a valid name that would be known to the server\&.
987.PP
988smbclient supports long file names where the server supports the LANMAN2 protocol or above\&.
989.SH "ENVIRONMENT VARIABLES"
990.PP
991The variable
992\fBUSER\fR
993may contain the username of the person using the client\&. This information is used only if the protocol level is high enough to support session\-level passwords\&.
994.PP
995The variable
996\fBPASSWD\fR
997may contain the password of the person using the client\&. This information is used only if the protocol level is high enough to support session\-level passwords\&.
998.PP
999The variable
1000\fBLIBSMB_PROG\fR
1001may contain the path, executed with system(), which the client should connect to instead of connecting to a server\&. This functionality is primarily intended as a development aid, and works best when using a LMHOSTS file
1002.SH "INSTALLATION"
1003.PP
1004The location of the client program is a matter for individual system administrators\&. The following are thus suggestions only\&.
1005.PP
1006It is recommended that the smbclient software be installed in the
1007/usr/local/samba/bin/
1008or
1009/usr/samba/bin/
1010directory, this directory readable by all, writeable only by root\&. The client program itself should be executable by all\&. The client should
1011\fINOT\fR
1012be setuid or setgid!
1013.PP
1014The client log files should be put in a directory readable and writeable only by the user\&.
1015.PP
1016To test the client, you will need to know the name of a running SMB/CIFS server\&. It is possible to run
1017\fBsmbd\fR(8)
1018as an ordinary user \- running that server as a daemon on a user\-accessible port (typically any port number over 1024) would provide a suitable test server\&.
1019.SH "DIAGNOSTICS"
1020.PP
1021Most diagnostics issued by the client are logged in a specified log file\&. The log file name is specified at compile time, but may be overridden on the command line\&.
1022.PP
1023The number and nature of diagnostics available depends on the debug level used by the client\&. If you have problems, set the debug level to 3 and peruse the log files\&.
1024.SH "VERSION"
1025.PP
1026This man page is correct for version 3\&.2 of the Samba suite\&.
1027.SH "AUTHOR"
1028.PP
1029The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
1030.PP
1031The original Samba man pages were written by Karl Auer\&. The man page sources were converted to YODL format (another excellent piece of Open Source software, available at
1032ftp://ftp\&.icce\&.rug\&.nl/pub/unix/) and updated for the Samba 2\&.0 release by Jeremy Allison\&. The conversion to DocBook for Samba 2\&.2 was done by Gerald Carter\&. The conversion to DocBook XML 4\&.2 for Samba 3\&.0 was done by Alexander Bokovoy\&.
Note: See TracBrowser for help on using the repository browser.