SMBCLIENT(1) SMBCLIENT(1) NAME smbclient - FTPSMB/CIFS SYNOPSIS smbclient {servicename} [password] [-b ] [-d debuglevel] [-D Directory] [-U username] [-W workgroup] [-M ] [-m maxprotocol] [-A authfile] [-N] [-l logfile] [-L ] [-I destinationIP] [-E] [-c ] [-i scope] [-O ] [-p port] [-R ] [-s ] [-TIXFqgbNan] [-k] DESCRIPTION Samba(7) smbclient SMB/CIFS"" FTP(ftp (1)) OPTIONS servicename servicename//server/serviceserver SMB/CIFSNetBIOSservice "smbserver""printer"//smbserver/printer IP(DNS)NetBIOSIP smbclient-R smb.conf(5) password password-N(suppress password prompt) (-U- fR)-N() (OS/2Windows for Workgroups) () -R SambaIP "lmhosts""host""wins""bcast" lmhosts: SambalmhostsIPIf the line in lmhosts has no name type attached to the NetBIOS name (see the lmhosts(5) for details) then any name type matches for lookup. host: IP/etc/hostsNISDNSIRIXSolaris/etc/nsswitch.conf Note that this method is only used if the NetBIOS name type being queried is the 0x20 (server) name type, otherwise it is ignored. wins: wins serverWINS bcast: interfaces smb.conf(5)(name resolve order) lmhostshostwinsbcastsmb.conf(5)name resolve order -M NetBIOS name "WinPopup" ^D(Ctl- D). WinPopupWinPopup 1600 smbclientcat cat mymessage.txt | smbclient -M FRED mymessage.txt FRED. -U-I smb.conf(5)message commandSambaWinPopup WfWg PCWinPopupWindows"" -p port TCP()SMB/CIFSTCP139 -h|--help -I IP-address IP"a.b.c.d" clientname resolve orderNetBIOSSMB/CIFSIPNetBIOS -E (stderr) - tty -L smbclient -L host NetBIOSTCP/IP-I -t terminal code smbclientUNIXSMB/CIFS(EUC SJIS)smbclient UNIXSMB CWsjis, CWeuc, CWjis7, CWjis8, CWjunet, CWhex, CWcap. samba -b buffersize /65520Win9x(1200) -V Prints the program version number. -s printcapsmb.conf -d|--debug=debuglevel debuglevel 0100 01 13 smb.conf (5)log level -l|--logfile=logbasename .client -N -k Try to authenticate with kerberos. Only useful in an Active Directory environment. -A|--authfile=filename This 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 username = password = domain = Make certain that the permissions on the file restrict access from unwanted users. -U|--user=username[%password] %passwordUSERLOGNAMEGUEST 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 -A for more details. PASSWDpsrpcclient -n NetBIOSsmb.confnetbios name -i NetBIOSnmblookupNetBIOSNetBIOSrfc1001.txtrfc1002.txtNetBIOSNetBIOS -W|--workgroup=domain SMBsmb.confNetBIOSlocal SAM(SAM). -O socket options TCPsmb.conf(5)socket options -T tar options smbclientSMB/CIFStar(1) tar c - unixtar"-" -d0tarx x - tar()-Dtar"-"c(mtime)tar, I - -Ttar()r X - r b - (0)*TBLOCK(512) g - c q - tar r - HAVE_REGEX_HHAVE_REGEX_H'*''?' N - (newer). c a -gfIc. Tar Long File Names smbclienttar1024 smbclienttar Tar Filenames DOS('\\')UNIX('/') backup.tarmypcmyshare() smbclient //mypc/yshare "" -N -Tx backup.tar users/docs smbclient //mypc/myshare "" -N -TXx backup.tar users/docs users/docs smbclient //mypc/myshare "" -N -Tc backup.tar users/docs DOS smbclient //mypc/myshare "" -N -tc backup.tar users\docs () smbclient //mypc/myshare "" -N -Tc backup.tar * -D initial directory tar-T -c command string ("'") -N -c 'print -' OPERATIONS smb:\> ("\\") "a long file name" ("[]")<> ? [command] command ?? ! [shell command] shell command!shell shell altname file The client will request that the server return the "alternate" name (the 8.3 name) for a file or directory. cancel jobid0 [jobid1] ... [jobidN] The client will request that the server cancel the printjobs identified by the given numeric print job ids. chmod file mode in octal This 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. chown file uid gid This 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. cd [directory name] "directory name" del mask dir mask exit get [local file name] remote file namelocal file namesmbclientlowercase help [command] ? lcd [directory name] directory name link source destination This 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 source and destination files. The source file must not exist. lowercase getmget getmgetMSDOS UNIX ls dir mask mgetmput() mgetmput() maskmget"source*"mask"*.c"mget"source*""*.c" ()("*")maskmgetmput"*" md mkdir mget mask mask - recursemasksmbclientlowercase mkdir () mput mask mask - recursemasksmbclient print printmode printmode () prompt mgetmput put [remote file name] local file nameremote file namesmbclient lowercase queue quit exit rd rmdir recurse mgetmput maskmask mask rm mask rmdir setmode DOSattrib setmode myfile +r myfile symlink source destination This 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 source and destination files. The source 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. tar [IXbgNa] tar -T tarmodeg()N()tarmode tar x"-" blocksize (0)tarblocksize*TBLOCK(512) tarmode tartartar(/) NOTES () -nOS/2 LanManagerNetBIOS smbclientLANMAN2 ENVIRONMENT VARIABLES USER PASSWD The variable LIBSMB_PROG may 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 INSTALLATION smbclient/usr/local/samba/bin/ /usr/samba/bin/rootsetuidsetgid SMB/CIFSsmbd(8) a(1024) DIAGNOSTICS 3 VERSION Samba2.2 AUTHOR sambaAndrew TridgellsambaSamba Team linux samba Karl Auer YODL(ftp://ftp.ice.rug.nl/pub/unix)Jeremy Sllison Samba2.0 Gerald Carter Samba2.2DocBook Alexander Bokovoy Samba 3.0DocBook XML4.2 [] meaculpa [] 2000/12/08 linuxman: http://cmpp.linuxforum.net man man https://github.com/man-pages-zh/manpages- zh SMBCLIENT(1)