1SMBGET(1) User Commands SMBGET(1)
2
3
4
6 smbget - wget-like utility for download files over SMB
7
9 smbget [-a, --guest] [-r, --resume] [--recursive] [-D, --dots]
10 [-o, --outputfile] [-q, --quiet] [-v, --verbose] [-b, --blocksize]
11 [-O, --stdout] [-u, --update] [-e, --encrypt] [--limit-rate=INT]
12 [-?|--help] [--usage] [-d|--debuglevel=DEBUGLEVEL] [--debug-stdout]
13 [-s|--configfile=CONFIGFILE] [--option=name=value]
14 [-l|--log-basename=LOGFILEBASE] [--leak-report] [--leak-report-full]
15 [-R|--name-resolve=NAME-RESOLVE-ORDER]
16 [-O|--socket-options=SOCKETOPTIONS] [-m|--max-protocol=MAXPROTOCOL]
17 [-n|--netbiosname=NETBIOSNAME] [--netbios-scope=SCOPE]
18 [-W|--workgroup=WORKGROUP] [--realm=REALM]
19 [-U|--user=[DOMAIN/]USERNAME%[PASSWORD]] [-N|--no-pass]
20 [--password=STRING] [--pw-nt-hash] [-A|--authentication-file=FILE]
21 [-P|--machine-pass] [--simple-bind-dn=DN]
22 [--use-kerberos=desired|required|off] [--use-krb5-ccache=CCACHE]
23 [--use-winbind-ccache] [--client-protection=sign|encrypt|off]
24 [-V|--version] {smb://host/share/path/to/file} [smb://url2/] [...]
25
27 This tool is part of the samba(7) suite.
28
29 smbget is a simple utility with wget-like semantics, that can download
30 files from SMB servers. You can specify the files you would like to
31 download on the command-line.
32
33 The files should be in the smb-URL standard, e.g. use
34 smb://host/share/file for the UNC path \\\\HOST\\SHARE\\file.
35
37 -a, --guest
38 Work as user guest
39
40 -r, --resume
41 Automatically resume aborted files
42
43 --recursive
44 Recursively download files
45
46 -D, --dots
47 Show dots as progress indication
48
49 -o, --outputfile
50 Write the file that is being downloaded to the specified file. Can
51 not be used together with -R.
52
53 --stdout
54 Write the file that is being downloaded to standard output.
55
56 -q, --quiet
57 Be quiet
58
59 -v, --verbose
60 Be verbose
61
62 -b, --blocksize
63 Number of bytes to download in a block. Defaults to 64000.
64
65 -u, --update
66 Download only when remote file is newer than local file or local
67 file is missing.
68
69 -e, --encrypt
70 Enable SMB encryption.
71
72 --limit-rate=INT
73 Limit download rate by this many KB/s.
74
75 -?|--help
76 Print a summary of command line options.
77
78 --usage
79 Display brief usage message.
80
81 -d|--debuglevel=DEBUGLEVEL
82 level is an integer from 0 to 10. The default value if this
83 parameter is not specified is 1 for client applications.
84
85 The higher this value, the more detail will be logged to the log
86 files about the activities of the server. At level 0, only critical
87 errors and serious warnings will be logged. Level 1 is a reasonable
88 level for day-to-day running - it generates a small amount of
89 information about operations carried out.
90
91 Levels above 1 will generate considerable amounts of log data, and
92 should only be used when investigating a problem. Levels above 3
93 are designed for use only by developers and generate HUGE amounts
94 of log data, most of which is extremely cryptic.
95
96 Note that specifying this parameter here will override the log
97 level parameter in the /etc/samba/smb.conf file.
98
99 --debug-stdout
100 This will redirect debug output to STDOUT. By default all clients
101 are logging to STDERR.
102
103 --configfile=<configuration file>
104 The file specified contains the configuration details required by
105 the client. The information in this file can be general for client
106 and server or only provide client specific like options such as
107 client smb encrypt. See /etc/samba/smb.conf for more information.
108 The default configuration file name is determined at compile time.
109
110 --option=<name>=<value>
111 Set the smb.conf(5) option "<name>" to value "<value>" from the
112 command line. This overrides compiled-in defaults and options read
113 from the configuration file. If a name or a value includes a space,
114 wrap whole --option=name=value into quotes.
115
116 -l|--log-basename=logdirectory
117 Base directory name for log/debug files. The extension ".progname"
118 will be appended (e.g. log.smbclient, log.smbd, etc...). The log
119 file is never removed by the client.
120
121 --leak-report
122 Enable talloc leak reporting on exit.
123
124 --leak-report-full
125 Enable full talloc leak reporting on exit.
126
127 -V|--version
128 Prints the program version number.
129
130 -R|--name-resolve=NAME-RESOLVE-ORDER
131 This option is used to determine what naming services and in what
132 order to resolve host names to IP addresses. The option takes a
133 space-separated string of different name resolution options. The
134 best is to wrap the whole --name-resolve=NAME-RESOLVE-ORDER into
135 quotes.
136
137 The options are: "lmhosts", "host", "wins" and "bcast". They cause
138 names to be resolved as follows:
139
140 • lmhosts: Lookup an IP address in the Samba lmhosts file.
141 If the line in lmhosts has no name type attached to the
142 NetBIOS name (see the lmhosts(5) for details) then any
143 name type matches for lookup.
144
145 • host: Do a standard host name to IP address resolution,
146 using the system /etc/hosts, NIS, or DNS lookups. This
147 method of name resolution is operating system dependent,
148 for instance on IRIX or Solaris this may be controlled
149 by the /etc/nsswitch.conf file). Note that this method
150 is only used if the NetBIOS name type being queried is
151 the 0x20 (server) name type, otherwise it is ignored.
152
153 • wins: Query a name with the IP address listed in the
154 wins server parameter. If no WINS server has been
155 specified this method will be ignored.
156
157 • bcast: Do a broadcast on each of the known local
158 interfaces listed in the interfaces parameter. This is
159 the least reliable of the name resolution methods as it
160 depends on the target host being on a locally connected
161 subnet.
162
163 If this parameter is not set then the name resolve order defined in
164 the /etc/samba/smb.conf file parameter (name resolve order) will be
165 used.
166
167 The default order is lmhosts, host, wins, bcast. Without this
168 parameter or any entry in the name resolve order parameter of the
169 /etc/samba/smb.conf file, the name resolution methods will be
170 attempted in this order.
171
172 -O|--socket-options=SOCKETOPTIONS
173 TCP socket options to set on the client socket. See the socket
174 options parameter in the /etc/samba/smb.conf manual page for the
175 list of valid options.
176
177 -m|--max-protocol=MAXPROTOCOL
178 The value of the parameter (a string) is the highest protocol level
179 that will be supported by the client.
180
181 Note that specifying this parameter here will override the client
182 max protocol parameter in the /etc/samba/smb.conf file.
183
184 -n|--netbiosname=NETBIOSNAME
185 This option allows you to override the NetBIOS name that Samba uses
186 for itself. This is identical to setting the netbios name parameter
187 in the /etc/samba/smb.conf file. However, a command line setting
188 will take precedence over settings in /etc/samba/smb.conf.
189
190 --netbios-scope=SCOPE
191 This specifies a NetBIOS scope that nmblookup will use to
192 communicate with when generating NetBIOS names. For details on the
193 use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS
194 scopes are very rarely used, only set this parameter if you are the
195 system administrator in charge of all the NetBIOS systems you
196 communicate with.
197
198 -W|--workgroup=WORKGROUP
199 Set the SMB domain of the username. This overrides the default
200 domain which is the domain defined in smb.conf. If the domain
201 specified is the same as the servers NetBIOS name, it causes the
202 client to log on using the servers local SAM (as opposed to the
203 Domain SAM).
204
205 Note that specifying this parameter here will override the
206 workgroup parameter in the /etc/samba/smb.conf file.
207
208 -r|--realm=REALM
209 Set the realm for the domain.
210
211 Note that specifying this parameter here will override the realm
212 parameter in the /etc/samba/smb.conf file.
213
214 -U|--user=[DOMAIN\]USERNAME[%PASSWORD]
215 Sets the SMB username or username and password.
216
217 If %PASSWORD is not specified, the user will be prompted. The
218 client will first check the USER environment variable (which is
219 also permitted to also contain the password separated by a %), then
220 the LOGNAME variable (which is not permitted to contain a password)
221 and if either exists, the value is used. If these environmental
222 variables are not found, the username found in a Kerberos
223 Credentials cache may be used.
224
225 A third option is to use a credentials file which contains the
226 plaintext of the username and password. This option is mainly
227 provided for scripts where the admin does not wish to pass the
228 credentials on the command line or via environment variables. If
229 this method is used, make certain that the permissions on the file
230 restrict access from unwanted users. See the -A for more details.
231
232 Be cautious about including passwords in scripts or passing
233 user-supplied values onto the command line. For security it is
234 better to let the Samba client tool ask for the password if needed,
235 or obtain the password once with kinit.
236
237 While Samba will attempt to scrub the password from the process
238 title (as seen in ps), this is after startup and so is subject to a
239 race.
240
241 -N|--no-pass
242 If specified, this parameter suppresses the normal password prompt
243 from the client to the user. This is useful when accessing a
244 service that does not require a password.
245
246 Unless a password is specified on the command line or this
247 parameter is specified, the client will request a password.
248
249 If a password is specified on the command line and this option is
250 also defined the password on the command line will be silently
251 ignored and no password will be used.
252
253 --password
254 Specify the password on the commandline.
255
256 Be cautious about including passwords in scripts or passing
257 user-supplied values onto the command line. For security it is
258 better to let the Samba client tool ask for the password if needed,
259 or obtain the password once with kinit.
260
261 If --password is not specified, the tool will check the PASSWD
262 environment variable, followed by PASSWD_FD which is expected to
263 contain an open file descriptor (FD) number.
264
265 Finally it will check PASSWD_FILE (containing a file path to be
266 opened). The file should only contain the password. Make certain
267 that the permissions on the file restrict access from unwanted
268 users!
269
270 While Samba will attempt to scrub the password from the process
271 title (as seen in ps), this is after startup and so is subject to a
272 race.
273
274 --pw-nt-hash
275 The supplied password is the NT hash.
276
277 -A|--authentication-file=filename
278 This option allows you to specify a file from which to read the
279 username and password used in the connection. The format of the
280 file is:
281
282 username = <value>
283 password = <value>
284 domain = <value>
285
286
287 Make certain that the permissions on the file restrict access from
288 unwanted users!
289
290 -P|--machine-pass
291 Use stored machine account password.
292
293 --simple-bind-dn=DN
294 DN to use for a simple bind.
295
296 --use-kerberos=desired|required|off
297 This parameter determines whether Samba client tools will try to
298 authenticate using Kerberos. For Kerberos authentication you need
299 to use dns names instead of IP addresses when connecting to a
300 service.
301
302 Note that specifying this parameter here will override the client
303 use kerberos parameter in the /etc/samba/smb.conf file.
304
305 --use-krb5-ccache=CCACHE
306 Specifies the credential cache location for Kerberos
307 authentication.
308
309 This will set --use-kerberos=required too.
310
311 --use-winbind-ccache
312 Try to use the credential cache by winbind.
313
314 --client-protection=sign|encrypt|off
315 Sets the connection protection the client tool should use.
316
317 Note that specifying this parameter here will override the client
318 protection parameter in the /etc/samba/smb.conf file.
319
320 In case you need more fine grained control you can use:
321 --option=clientsmbencrypt=OPTION, --option=clientipcsigning=OPTION,
322 --option=clientsigning=OPTION.
323
325 SMB URL's should be specified in the following format:
326
327 smb://[[[domain;]user[:password@]]server[/share[/path[/file]]]]
328
329 smb:// means all the workgroups
330
331 smb://name/ means, if name is a workgroup, all the servers in this workgroup, or if name is a server, all the shares on this server.
332
334 # Recursively download 'src' directory
335 smbget --recursive smb://rhonwyn/jelmer/src
336 # Download FreeBSD ISO and enable resuming
337 smbget --resume smb://rhonwyn/isos/FreeBSD5.1.iso
338 # Recursively download all ISOs
339 smbget --recursive --resume smb://rhonwyn/isos
340 # Backup my data on rhonwyn
341 smbget --recursive -resume smb://rhonwyn/
342
344 Permission denied is returned in some cases where the cause of the
345 error is unknown (such as an illegally formatted smb:// url or trying
346 to get a directory without --resursive turned on).
347
349 This man page is part of version 4.19.3 of the Samba suite.
350
352 The original Samba software and related utilities were created by
353 Andrew Tridgell. Samba is now developed by the Samba Team as an Open
354 Source project similar to the way the Linux kernel is developed.
355
356 The smbget manpage was written by Jelmer Vernooij.
357
358
359
360Samba 4.19.3 11/27/2023 SMBGET(1)