On the samba server my blog-Linux general technology-Linux technology and application information. The following is a detailed description. Samba is charming like Samba in Brazil. When there are multiple operating systems in the LAN, samba serves as a bridge for communication. In details, samba has many functions, but sharing files and printers in the LAN is his main function. What is his identity and permissions, you can also use the nmbd service to build the NBNS service. NBNS is the NetBios Name Service, which resolves the computer's Netbios Name into an IP address.
The working principle of Samba is very simple. First, there is a protocol negotiation process between the client and the server, and the optimal SMB type is selected using the domain. As for what is the SMB type, I'm curious to google it. The link is established. After the client passes authentication, the server will assign a unique UID to the client for communication. In this way, the client can access the shared resources provided by the server. After the access, the link is disconnected. The samba service is complete once.
The installation of Samba should be very simple. It seems that three packages are needed under the red hat, the samba main file package, the client Toolkit (which seems to have been installed by default), and a general tool kit. You can also query this rpm-qa | grep samba and install it in rpm-ivh samba. In Ubuntu, sudo apt-get install XXX.
After installation, you can configure the master file. The general idea of configuration is as follows: edit the smb. conf file to specify the shared directory and permissions. Specify the log file name and storage path. Finally, set the local permission for the shared directory. Restart the service or load the configuration file to make the service take effect.
We use this command to open smb. conf: vi/etc/samba/smb. conf. there should be a lot of text to be seen after opening, but most of them begin. You will find that # starts with some comments, and; starts with some configuration templates. Ignore this, and few things need to be configured. Let's take a look at Global Settings and Global Settings. Pay attention to several key information here. Workgroup = XX is followed by the working group name. serer string = XX is used to add comments. Next, this is very important, security = xx indicates that the security level is set. There are five Security modes. The default mode is the user mode, that is, the information needs to be verified normally. Enter the user name and password. The share mode does not need to be verified, so the security is worse. However, there is no such thing as a wicked person in the LAN, and it is very convenient to set share. There are also 3 medium security mode servers, domain, ads. Curious to google, just google it. Next, specify the log file to the directory. Make it/var/log/samba/XX. log.
After the global configuration is complete, configure the sharing part. Comment = XX is followed by comments, and you can write them at will. If you are not a girl. The path = XXX below is important. The requirement is to share the directory to the complete path. Remember that it is complete. Public = yes indicates that anonymous access is allowed, or no is allowed. In this case, the permission settings can be set as follows: readonly = yes or writable = no indicates read-only. Do you want to change it to read-write? Try yes or no on your own.
Basically, the configuration is complete. Service smb restart or/etc/rc. d/init. d/smb start
By the way, log on to the samba server and use the smbpasswd command to set the samba password.
You can log on to the client in two ways. 1 is the target smbclient-L ip address or name-U username % password after the samba-client package is installed.
You can also use the mount command to mount-t cifs // ip/directory to the "-o username = username" directory. As for the meaning of cifs in the above sentence, I don't understand it either.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.