Samba sharing configuration

There are two shared directories: a common normal, a important. Ordinary users are registered on the normal rw permissions for important directory only r rights; administrative privileges to normal, important directory has read and write access.
Here are the steps:
First, install samba
Second, create a user
The establishment of two groups:
#groupadd nomal
#groupadd admin
Add users and join related groups which:
#useradd normal -g normal
#useradd admin -g admin
#smbpasswd -a normal create a password for the user
#smbpasswd -a admin
Create a shared directory and change the permissions
#sudo mkdir /home/share
#sudo mkdir /home/share/Normal
#sudo mkdir /home/share/Important
Change the shared directory permissions
#sudo chmod -R 777 /home/share
Three, samba configuration
To back up the default smb.conf configuration file.
#sudo mv /etc/samba/smb.conf /etc/samba/smb.conf-bak
Then create a configuration file with the same name
#sudo came /etc/samba/smb.conf
The following is the configuration file content:
[global]
workgroup = WORKGROUP
#hosts allow =219.246.178.
# Describe my server name
security=user

# Use user authentication mechanism

encrypt passwords = true
smb passwd file=/etc/samba/smbpasswd
#[homes]
#comment = Home Directories
#browseable = yes
#writable = yes
[Normal]
comment=Normal
path=/home/shared/Normal
writable =yes
#browseable =yes
#create mode =0664
#directory mode=0777
public=no
valid users=nomal admin
write list=nomal admin
read list =nomal admin
[Important]
comment=Important
path=/home/shared/Important
public=no
#browseable=yes
valid users=nomal admin
write list=admin
read list =nomal admin
Fourth, you can restart the smb service
sudo service smbd restart

sudo service nmbd restart

 

Guess you like

Origin www.cnblogs.com/bongem/p/12099736.html