Samba study Note 3: Samba's Application in reality and its combination with Yiyou
Source: Internet
Author: User
Samba study Note 3: Samba's practical application and experience in combination with Yiyou-Linux Enterprise Application-Linux server application information. For details, refer to the following. Samba study Note 3: Samba's Application in reality and its combination with Yiyou
The above is some of the experience I encountered in my practical work on Samba file server, reprint please indicate the source of fuqin boiled wine blog http://hi.baidu.com/yuhongchun027
In the Samba service, you can implement flexible host access control. In actual work, for example, if you do not want the computer on the front-end (such as the information inquiry) to access your Samba file server, you can go to smb. hosts. the allow command is used to add commands to limit the incoming host.
[Global]
Hosts allow = 192.168.1. hosts t 192.168.1.100
At this time, machines with IP address 192.168.1.100 cannot access your Samba file server ,:
The domain name format is also supported. For example, hosts allow = test.com cannot be www.test.com, but your DNS must be able to parse it.
When setting up an easy-to-play server and in actual work, you often encounter this situation, that is, a directory can only be read from an ordinary account st02, but it is not difficult to implement the update function of an advanced account, the solution is as follows:
(1) create two accounts: st02 // represents a common user or a common employee; update // represents a senior user or a leader. Both accounts must be added to the samba database to become samba users, run smbpasswd-. add accounts to group1 group. Use useradd-g group1 st02 or update when adding accounts.
(2) create a shared directory and grant corresponding Permissions
# Mkdir-p/home/member
# Chmoe 777/home/member // set the permission of the shared directory to 777, that is, all user services can be read and written, the purpose is to verify that Samba's user access control function is used to restrict the access permissions of different user services to this directory.
(3) vi/etc/samba/smb. conf
[MEMBER]
Path =/home/member
Valid users = @ group1 // specify that the legitimate user of this share is a user of group1.
Writeable = no // by default, the write permission of the shared object is disabled.
Write list = @ update // overwrite the shared write permission. That is, the update user can write data to the shared directory.
In addition, the security item is user.
Restart the Samba service to meet the above requirements. There are a lot of tutorials for writing samba online, but I feel that the content is the same and the practicality is not strong. This article combines the ease of travel with practical applications, it should help you (fuqin cooking)
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service