Article Title: how to set up and configure the Samba service in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The environment we want to implement today is: if the company has three departments: finance, technology, and leadership, we have created three user groups: caiwu, network, and lingdao;
There are two users in each of the three departments. The created users are caiwu01, caiwu02, network01, network02, lingdao01, and lingdao02.
Then, we create the corresponding directories and access permissions for the company's specific circumstances. Through the following example, we hope that you can flexibly apply samba security permissions in your work to set up your samba file server.
1. First, the server uses user authentication. Each user can access his/her home directory, and only the user can access the home directory with full permissions, others cannot see your home directory.
2. Create a caiwu folder. If you want the Members of the caiwu group and lingdao group to see the folder, network02 can also be accessed, but only caiwu01 has the write permission.
3. Create a lindao directory. Only the leaders can access and read/write the directory, and network02 can also be accessed, but outsiders cannot see the directory.
4. Create a file exchange directory for everyone to read and write, including guest users, but everyone cannot delete others' files.
5. Create a public read-only folder named public. All users can read the contents of this folder.
Okay. Let's start with the preliminary work.
Create three groups:
# Groupadd caiwu
# Groupadd network
# Groupadd lingdao
Add a user to the relevant group:
# Useradd caiwu01-g caiwu
# Useradd caiwu02-g caiwu
# Useradd network01-g network
# Useradd network02-g network
# Useradd lingdao01-g lingdao
# Useradd lingdao02-g lingdao
Then we use the smbpasswd-a caiwu01 command to add the six accounts to the samba users respectively.
# Mkdir/home/samba
# Mkdir/home/samba/caiwu
# Mkdir/home/samba/lingdao
# Mkdir/home/samba/exchange
# Mkdir/home/samba/public
[1] [2] [3] Next page