HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

smbclient — FTP-like client to access SMB/CIFS resources on servers. More information: <https://manned.org/smbcl

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandclientsmbclientlikeaccesscliftpsmb
linux

Problem

How to use the smbclient command: FTP-like client to access SMB/CIFS resources on servers. More information: <https://manned.org/smbclient>.

Solution

smbclient — FTP-like client to access SMB/CIFS resources on servers. More information: <https://manned.org/smbclient>.

Connect to a share (user will be prompted for password; exit to quit the session):
smbclient {{//server/share}}


Connect with a different username:
smbclient {{//server/share}} --user {{username}}


Connect with a different workgroup:
smbclient {{//server/share}} --workgroup {{domain}} --user {{username}}


Connect with a username and password:
smbclient {{//server/share}} --user {{username%password}}


Download a file from the server:
smbclient {{//server/share}} --directory {{path/to/directory}} --command "get {{file.txt}}"


Upload a file to the server:
smbclient {{//server/share}} --directory {{path/to/directory}} --command "put {{file.txt}}"


List the shares from a server anonymously:
smbclient --list={{server}} --no-pass

Code Snippets

Connect to a share (user will be prompted for password; `exit` to quit the session)

smbclient {{//server/share}}

Connect with a different username

smbclient {{//server/share}} --user {{username}}

Connect with a different workgroup

smbclient {{//server/share}} --workgroup {{domain}} --user {{username}}

Connect with a username and password

smbclient {{//server/share}} --user {{username%password}}

Download a file from the server

smbclient {{//server/share}} --directory {{path/to/directory}} --command "get {{file.txt}}"

Context

tldr-pages: linux/smbclient

Revisions (0)

No revisions yet.