Linux command
smbclient 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Connect
smbclient //[server]/[share]
Example
smbclient //[server]/[share] --user [username]
Example
smbclient //[server]/[share] --workgroup [domain] --user [username]
Example
smbclient //[server]/[share] --user [username%password]
Download
smbclient //[server]/[share] --directory [path] --command "get [file.txt]"
Upload
smbclient //[server]/[share] --directory [path] --command "put [file.txt]"
List shares
smbclient --list=[server] --no-pass
说明
smbclient is an FTP-like client for accessing SMB/CIFS network shares. It connects to Windows file servers and Samba shares, enabling file transfers, directory operations, and share browsing from the command line. The tool supports interactive sessions with FTP-style commands or batch operations via -c flag. It can create tar backups of shares and browse available network resources.
参数
- -U, --user _username%password_
- Specify username and optional password
- -W, --workgroup _domain_
- Set SMB workgroup/domain
- -N, --no-pass
- Suppress password prompt for anonymous access
- -L, --list _host_
- List available shares on server
- -D, --directory _path_
- Change to initial directory on connection
- -c, --command _commands_
- Execute semicolon-separated commands
- -I, --ip-address _ip_
- Specify server IP directly
- -p, --port _port_
- TCP port (default: 139 or 445)
- -m, --max-protocol _level_
- Maximum SMB protocol (NT1, SMB2, SMB3)
- -A, --authentication-file _file_
- Read credentials from file
- -T, --tar _options_
- Tar backup mode with flags
- -d, --debuglevel _level_
- Debug verbosity (0-10)
- -n, --netbiosname _name_
- Override client NetBIOS name
FAQ
What is the smbclient command used for?
smbclient is an FTP-like client for accessing SMB/CIFS network shares. It connects to Windows file servers and Samba shares, enabling file transfers, directory operations, and share browsing from the command line. The tool supports interactive sessions with FTP-style commands or batch operations via -c flag. It can create tar backups of shares and browse available network resources.
How do I run a basic smbclient example?
Run `smbclient //[server]/[share]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -U, --user _username%password_ do in smbclient?
Specify username and optional password