smbclient SMB share client
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
smbclient -L <host> -U <user>
smbclient //<host>/<share> -U
<user>
lscd <dir>get <file>
put <file>
mget <mask>
exitConcepts
- smbclient -L find shares
- //host/share authenticate
- Prompt ls, get, put
Connect
smbclient -L <host>
smbclient -L <host> -N
smbclient //<host>/<share>
smbclient //<host>/<share> -U
<user>
smbclient //<host>/<share> -U
<domain>\\<user>
smbclient //<host>/<share> -N
smbclient //<host>/<share> -A
<file>
smbclient //<host>/<share> -I <ip>
smbclient //<host>/<share> -p
<port>
smbclient //<host>/<share> -m SMB3
smbclient //<host>/<share>
--use-kerberos=required
smbclient //<host>/<share>
--client-protection=encrypt
smbclient -L <host> -g
Navigate
ls [<mask>]
dir [<mask>]
cd <dir>lcd <dir>du <dir>! <command>
more <file>
help [<command>]
exithistoryTransfer
get <remote> [<local>]
put <local> [<remote>]
mget <mask>
mput <mask>
promptrecursemask <mask>
lowercaseiosize <bytes>
scopy <src> <dst>
Manage files
mkdir <dir>
rmdir <dir>
del <mask>
deltree <mask>
rename <old> <new>
allinfo <file>
setmode <file> +r
notify <dir>
Scripting
smbclient //<host>/<share> -c
"<cmds>"
smbclient //<host>/<share> -U
<user>%<pass>
smbclient //<host>/<share> -c "ls"
-E
smbclient //<host>/<share> -d
<level>
smbclient //<host>/<share> -t
<seconds>
smbclient //<host>/<share>
--option="<name>=<value>"
Tar backup
smbclient //<host>/<share> -Tc
<file>.tar
smbclient //<host>/<share> -Tx
<file>.tar
smbclient //<host>/<share> -Tc <file>.tar
<path>
smbclient //<host>/<share> -Tcg
<file>.tar
smbclient //<host>/<share> -Tcn
<file>.tar
tar c <file>.tar
Recipes
smbclient //<host>/<share> -U <user>smb: \> cd <dir>smb: \> recurse ONsmb: \> prompt OFFsmb: \> mget *
smbclient //<host>/<share> -A ~/.smbcred \ -c "cd <dir>; put report.pdf"
smbclient //<host>/<share> -A ~/.smbcred \ -Tc backup.tar
smbclient -L <host> -U <user>sudo mount -t cifs //<host>/<share> /mnt \ -o username=<user>
Help
smbclient --help
man smbclient



