Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the Linux basic command smbclient

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "the usage of the Linux basic command smbclient". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the usage of the basic Linux command smbclient.

Smbclient

Smbclient is a samba server client management program, can interactively access the samba server.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, Fedora, SUSE, openSUSE.

1. Grammar

Smbclient servername [options]

2. List of options

Option

Description

-? |-- help

Show help documentation

-V |-- version

Display command version information

-R |-- name-resolve

Resolve NetBIOS names to the corresponding IP address order

-M |-- message

Send messages using winpopup protocol

-p |-- port

Specify the connection port, default TCP of 139,

-m |-- max-protocol

The maximum version of the agreement

-I |-- ip-address

Specify the ip address of the connection

-E |-- stderr

Send the information to the standard error device

-L |-- list

Display a list of resources for the server

-b |-- send-buffer

Set the buffer size for the transfer process

-e |-- encyrpt

Require the server to use encryption

-d |-- debuglevel

Set the debug mode level. The higher the level is, the more detailed the log will be.

-l |-log-basename

Directory where log files are stored

-N |-- no-pass

Do not use a password

A

Reads the username and password from the specified file in the following file format:

Username=

Password=

Domain=

-U |-- user=username [% password]

Specify user name and password

-n

Specify NetBIOS name

-W |-- workgroup

Specify the user's smb domain

-T |-- tar

Package the files shared by the server into tar format

S

Specify the smb.conf directory

3. Command

The commands supported after logging in to the samba server are

Command

Description

-? [cmd]

Displays a description of the command, and if you do not specify a command, list all command documents

! [shell]

Run shell

Allinfo file

Require the server to return information about all files or directories

Altname file

Require the server to return an alias for a file or directory

Archive

Set the archive level

Blocksize

Sets the block size of the package, which defaults to 20. The unit of the block is 521B

Case_sensitive

Set file case sensitivity

Cd

Switch directories

Chmod

Modify permissions

Chown

Modify uid and gid

Close

Close files opened with open

Del

Delete mask-compliant files in the current directory

Du

List directory information and disk information

Echo

The purpose of this instruction is to send ping test information to the server

Exit

Quit

Get

Get Fil

Hardlink

Create a hard connection

Iosize

Set the size of the memory buffer used when transferring files. The default is 64512 bytes. The range that can be set is 16384 "16776960.

Lowercase

Change all the letters in the received document to lowercase

Ls

View catalog information

Md

Create a directory

Mget

Get all files that match mask

Mkdir

Create a directory

Mput

Send all files that match msak in the current directory to the server

Put [remote file]

Send a file

Queue

Show print queue

Quit

Quit

Rd

Delete directory

Rmdir

Delete directory

Recurse

A switch that changes recursive options

Rename

Rename

Rm

Delete all files that match mask in the current directory

Showconnect

Show current connection

Stat file

Display file information

Tar

Compressed file

4. Examples

1) connect to the server

[root@localhost ~] # cat wj.txt / / View file contents

Username=david

Password=543092

[root@localhost ~] # smbclient / / 192.168.1.8/wj-A wj.txt / / Log in to the server and read the username and password from the specified file

Domain= [MYGROUP] OS= [Unix] Server= [Samba 3.6.23-51.el6]

Smb:\ >

2) View command

Smb:\ >? / / lists supported commands

? Allinfo altname archive blocksize

Cancel case_sensitive cd chmod chown

Close del dir du echo

Exit get getfacl geteas hardlink

Help history iosize lcd link

Lock lowercase ls l mask

Md mget mkdir more mput

Newer open posix posix_encrypt posix_open

Posix_mkdir posix_rmdir posix_unlink print prompt

Put pwd q queue quit

Readlink rd recurse reget rename

Reput rm rmdir showacls setea

Setmode stat symlink tar tarmode

Timeout translate unlock volume vuid

Wdel logon listconnect showconnect..

!

Smb:\ >? Allinfo / / View help information for the specified command

HELP allinfo:

Show all available info

Smb:\ >

3) upload files

Smb:\ > put wj.txt / / upload files

Putting file wj.txt as\ wj.txt (10.1 kb/s) (average 10.1 kb/s)

Smb:\ > ls wj.txt / / View the file and have gone to bed

Wj.txt A 31 Tue Oct 9 09:15:22 2018

49907 blocks of size 524288. 2282 blocks available

Smb:\ >

At this point, I believe you have a deeper understanding of "the use of the Linux basic command smbclient". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report