commands.sh

smbclient

all

FTP-like client to access SMB/CIFS resources on servers.

More info →

Options (5)

-L, --listboolean

List available shares on a server anonymously

Example: smbclient {{[-L|--list]}} {{server}} --no-pass
-U, --userboolean

Connect to a share as a specific user

Example: smbclient {{[-U|--user]}} {{domain/username}} //{{server}}/{{share}}
-W, --workgroupboolean

Connect to a share using a specific workgroup

Example: smbclient {{[-W|--workgroup]}} {{domain}} {{[-U|--user]}} {{username}} //{{server}}/{{share}}
-D, --directoryboolean

Download a file from a specific directory on a share

Example: smbclient {{[-U|--user]}} {{domain/username}} //{{server}}/{{share}} {{[-D|--directory]}} {{path/to/directory}} {{[-c|--command]}} 'get {{filename}}'
-c, --commandboolean

Download a file from a specific directory on a share

Example: smbclient {{[-U|--user]}} {{domain/username}} //{{server}}/{{share}} {{[-D|--directory]}} {{path/to/directory}} {{[-c|--command]}} 'get {{filename}}'

Examples (7)

List available shares on a server anonymously

smbclient [-L|--list] server --no-pass

Connect to a share (will prompt for a password)

smbclient //server/share

Connect to a share as a specific user

smbclient [-U|--user] domain/username //server/share

Connect to a share as a specific user with inline password

smbclient [-U|--user] domain/username%password //server/share

Connect to a share using a specific workgroup

smbclient [-W|--workgroup] domain [-U|--user] username //server/share

Download a file from a specific directory on a share

smbclient [-U|--user] domain/username //server/share [-D|--directory] path/to/directory [-c|--command] 'get filename'

Upload a file to a specific directory on a share

smbclient [-U|--user] domain/username //server/share [-D|--directory] path/to/directory [-c|--command] 'put path/to/local_file'
made by @shridhargupta | data from tldr-pages