samba

 第一步创建用户和组

     groupadd cover
     groupadd team
     groupadd user
     useradd cover1 -g cover
     useradd cover2 -g cover
     useradd team1 -g team
     useradd team2 -g team
     useradd user1 -g user
     useradd user2 -g user
     gpasswd -a cover1 cover
     gpasswd -a cover2 cover
     gpasswd -a team1 team
     gpasswd -a team2 team
     gpasswd -a user1 user
     gpasswd -a user2 user
第二部
在MNT下创建文件夹
mkdir /mnt/samba
mkdir /var/samba/user
mkdir /var/samba/team
mkdir /var/samba/cover

修改samba的配置文件
修改如下 
在最后一行添加个个文件的共享配置

[cover]
      path = /mnt/samba/cover
      writeable = yes
      browseable = no
      write list = @cover
      valid users = @cover
      invalid users = @team @user
[team]
      path = /mnt/samba/team
      browseable = yes
      writeable = yes
      read list = @cover user1
      write list = @team
      valid users = @team @cover user1
      invalid users = user2

[user]
      path = /mnt/samba/user
      browseable = yes
      writeable = yes
      read list = @cover
      write list = @user
      valid users = @user @cover
      invalid users = @team
给各个用户设置密码123321

smbpasswd -a cover1


service smb restart  重启服务


访问

 mount -t cifs //192.168.18.149/mnt/samba/public -o username=cover1 -u 123321



 

 

你可能感兴趣的:(samba)