📄 smbclient.1
字号:
.nfusername = <value>password = <value>domain = <value>.fiMake certain that the permissions on the file restrict access from unwanted users\&..TP\-U|\-\-user=username[%password]Sets the SMB username or username and password\&.If %password is not specified, the user will be prompted\&. The client will first check the \fBUSER\fR environment variable, then the \fBLOGNAME\fR variable and if either exists, the string is uppercased\&. If these environmental variables are not found, the username \fBGUEST\fR is used\&.A 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 \fI\-A\fR for more details\&.Be cautious about including passwords in scripts\&. Also, on many systems the command line of a running process may be seen via the \fBps\fR command\&. To be safe always allow \fBrpcclient\fR to prompt for a password and type it in directly\&..TP\-n <primary NetBIOS name>This option allows you to override the NetBIOS name that Samba uses for itself\&. This is identical to setting the parameter in the \fIsmb\&.conf\fR file\&. However, a command line setting will take precedence over settings in \fIsmb\&.conf\fR\&..TP\-i <scope>This specifies a NetBIOS scope that \fBnmblookup\fR will 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 \fBvery\fR rarely used, only set this parameter if you are the system administrator in charge of all the NetBIOS systems you communicate with\&..TP\-W|\-\-workgroup=domainSet 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)\&..TP\-O socket optionsTCP socket options to set on the client socket\&. See the socket options parameter in the \fIsmb\&.conf\fR manual page for the list of valid options\&..TP\-T tar optionssmbclient may be used to create \fBtar(1) \fR compatible backups of all the files on an SMB/CIFS share\&. The secondary tar flags that can be given to this option are :.RS.TP 3\(bu\fIc\fR \- 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\fIx\fR flag\&..TP\(bu\fIx\fR \- 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 \fIc\fR flag\&. 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\&..TP\(bu\fII\fR \- Include files and directories\&. Is the default behavior when filenames are specified above\&. Causes tar 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 r below\&..TP\(bu\fIX\fR \- Exclude files and directories\&. Causes tar files to be excluded from an extract or create\&. See example below\&. Filename globbing works in one of two ways now\&. See \fIr\fR below\&..TP\(bu\fIb\fR \- 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\&..TP\(bu\fIg\fR \- Incremental\&. Only back up files that have the archive bit set\&. Useful only with the\fIc\fR flag\&..TP\(bu\fIq\fR \- Quiet\&. Keeps tar from printing diagnostics as it works\&. This is the same as tarmode quiet\&..TP\(bu\fIr\fR \- 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 '?'\&..TP\(bu\fIN\fR \- 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\fIc\fR flag\&..TP\(bu\fIa\fR \- Set archive bit\&. Causes the archive bit to be reset when a file is backed up\&. Useful with the\fIg\fR and \fIc\fR flags\&..LP.RE.IP\fBTar Long File Names\fR\fBsmbclient\fR'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, \fBsmbclient\fR's tar option places all files in the archive with relative names, not absolute names\&.\fBTar Filenames\fRAll file names can be given as DOS path names (with '\\\\' as the component separator) or as UNIX path names (with '/' as the component separator)\&.\fBExamples\fRRestore from tar file \fIbackup\&.tar\fR into myshare on mypc (no password on share)\&.\fBsmbclient //mypc/yshare "" \-N \-Tx backup\&.tar \fRRestore everything except \fIusers/docs\fR \fBsmbclient //mypc/myshare "" \-N \-TXx backup\&.tar users/docs\fRCreate a tar file of the files beneath \fI users/docs\fR\&.\fBsmbclient //mypc/myshare "" \-N \-Tc backup\&.tar users/docs \fRCreate the same tar file as above, but now use a DOS path name\&.\fBsmbclient //mypc/myshare "" \-N \-tc backup\&.tar users\\edocs \fRCreate a tar file of all the files and directories in the share\&.\fBsmbclient //mypc/myshare "" \-N \-Tc backup\&.tar * \fR.TP\-D initial directoryChange to initial directory before starting\&. Probably only of any use with the tar \-T option\&..TP\-c command stringcommand string is a semicolon\-separated list of commands to be executed instead of prompting from stdin\&. \fI \-N\fR is implied by \fI\-c\fR\&.This is particularly useful in scripts and for printing stdin to the server, e\&.g\&. \fB\-c 'print \-'\fR\&..SH "OPERATIONS".PPOnce the client is running, the user is presented with a prompt :.PPsmb:\\>.PPThe backslash ("\\\\") indicates the current working directory on the server, and will change if the current working directory is changed\&..PPThe 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\&..PPYou can specify file names which have spaces in them by quoting the name with double quotes, for example "a long file name"\&..PPParameters 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\&..PPNote 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\&..PPThe commands available are given here in alphabetical order\&..TP? [command]If \fIcommand\fR is 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\&..TP! [shell command]If \fIshell command\fR is 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\&..TPaltname fileThe client will request that the server return the "alternate" name (the 8\&.3 name) for a file or directory\&..TPcase_sensitiveToggles 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\&..TPcancel jobid0 [jobid1] \&.\&.\&. [jobidN]The client will request that the server cancel the printjobs identified by the given numeric print job ids\&..TPchmod file mode in octalThis 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\&..TPchown file uid gidThis 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\&..TPcd [directory name]If "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\&.If no directory name is specified, the current working directory on the server will be reported\&..TPdel <mask>The client will request that the server attempt to delete all files matching \fImask\fR from the current working directory on the server\&..TPdir <mask>A list of the files matching \fImask\fR in the current working directory on the server will be retrieved from the server and displayed\&..TPexitTerminate the connection with the server and exit from the program\&.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -