Current location - Quotes Website - Team slogan - How to log in to SMB
How to log in to SMB
I hope I can understand SMEs. If it is a WINXP system, it is actually useless. The ports occupied by smbd are 139 and 445. This paper introduces the usage in Linux system.

Introduction to samba

Samba(SMB is its abbreviation) is a network server for Linux and Windows*** to enjoy files; Samba can be used to share files between Windows and Linux, and can also be used to share files between Linux and Linux. However, there is a better network file system NFS for file sharing between Linux, and NFS also needs to set up a server;

As we all know, every machine in the Windows network can be a file-sharing server or a client. Samba can also do this. For example, if a Linux machine is equipped with Samba server, it can act as a * * * shared server, or it can be used as a client to access the Windows*** shared file system in other networks or other Linux Sabmba servers.

In the Windows network, when we see the file sharing function of * * *, we can directly use the * * * folder as the local hard disk. In Linux, a file system with * * * is provided to the machines in the network through Samba, and * * * of other machines in the network can also be mounted on the local machine for use; This is different from FTP in a sense.

Function and application scope

It should be mainly used in networks with Windows and Linux systems. If a network environment is Linux or Unix system, Samba is not necessary, NFS is better; What service can you provide for us? Mainly * * * enjoy the file * * * enjoy the printer.

View Windows*** files in the network and Samba*** files in Linux system;

Generally speaking, we need to use smbclient;; Common usage is nothing more than the following;

[root @ localhost ~] # smbclient-l//IP address or computer name

Smbclient is a Linux client of Samba, which is used to view the resources on the server on a Linux machine. Or, like FTP, users can log on to Samba server, upload put and download get files, but it is not friendly to Chinese support.

View resources on the server;

Smbclient -L //IP [-U username]

If your Samba server is configured in user mode, you should add "-U user name", if it is in shared mode, you can omit it;

For example:

[root @ localhost ~]# SMB client-L// 192. 168. 1.3-U sir 0 1

Password: Please enter the password of user sir0 1

If you use the sharing mode, you can use it directly, regardless of the user and password;

[root @ localhost ~]# SMB client-L// 192. 168. 1.3

Password: Enter directly.

Login user identity Samba server * * *

After logging in as a user, you can download files like FTP users; Upload with put and download with get;

Smbclient //IP Address/* * * Shared Folder -U User

Note: Everyone knows the IP address, but you don't know your own. You can check it with /sbin/ifconfig. * * * Shared folder is defined as [* * * Shared folder] in smb.conf, such as [sir0 1]. -U user name indicates the user of Samba;

For example:

[root @ localhost ~]# SMB client// 192. 168. 1.3/sir 0 1-U sir 0 1

Password:

domain =[Linux sir]OS =[Unix]Server =[Samba 3 . 0 . 2 1 b-2]

SMB:\ & gt; Limit Switch (limit switch)

Description: After logging into Samba server, you can use some instructions of smbclient to upload and download files like FTP instructions.

Smbclient command description

Command description

Or help [command] provides help about help or commands.

! [SHELL command] Execute the SHELL command used, or let the user enter a SHELL prompt.

Switch the CD[ directory] to the specified directory on the server side. If not specified, smbclient will return the current local directory.

LCD[ Directory] switches to the directory specified by the client;

List the files in the current directory;

Exit or exit exit smbclient.

Get file 1 file2 downloads file 1 from the server and saves it on the local machine with the file name file2; If you don't want to change the name, you can omit file2.

Mgetfile1file2file3filen downloads multiple files from the server;

Md or mkdir directories create directories on the server.

The rd or rmdir directory deletes the directory on the server.

Put file 1 [file2] Upload a file file 1 to the server and rename it file2;

Mput file 1 file2 filen uploads multiple files to the server.

Re-compare

J.j.' s speech:

It's complicated, but since you answered, I'll give you something hard. I prefer a simple description.