[root@hds /]# yum install samba samba-client -y
[root@hds /]# useradd -s /sbin/nologin tom
[root@hds /]# useradd -s /sbin/nologin jerry
[root@hds /]# useradd -s /sbin/nologin jack
[root@hds /]# useradd -s /sbin/nologin man
useradd: group man exists - if you want to add this user to that group, use -g.
将man用户移动至man组即可
查看man组ID
[root@hds /]# cat /etc/group | grep man
man:x:15:
[root@hds /]# useradd -g 15 man
[root@hds /]# useradd -g 15 man
[root@hds /]# groupadd administration
[root@hds /]# groupadd sales
[root@hds /]# groupadd manager
[root@hds /]# gpasswd -a tom administration
Adding user tom to group administration
[root@hds /]# gpasswd -a jerry administration
Adding user jerry to group administration
[root@hds /]# gpasswd -a jerry sales
Adding user jerry to group sales
[root@hds /]# gpasswd -a jack sales
Adding user jack to group sales
[root@hds /]# gpasswd -a man manager
Adding user man to group manager
[root@hds samba]# mkdir /var/administration_share
[root@hds samba]# mkdir /var/sales_share
[root@hds samba]# mkdir /var/public_share
[root@hds /]# cd /etc/samba/
[root@hds samba]# smbpasswd -a tom
New SMB password:
Retype new SMB password:
Added user tom.
[root@hds samba]# smbpasswd -a jerry
New SMB password:
Retype new SMB password:
Added user jerry.
[root@hds samba]# smbpasswd -a jack
New SMB password:
Retype new SMB password:
Added user jack.
[root@hds samba]# smbpasswd -a man
New SMB password:
Retype new SMB password:
Added user man.
[root@hds var]# chmod 777 administration_share/
[root@hds var]# chmod 777 sales_share/
[root@hds var]# chmod 777 public_share/
[root@hds var]# systemctl restart smb
[root@hds var]# systemctl enable smb
Created symlink /etc/systemd/system/multi-user.target.wants/smb.service → /usr/lib/systemd/system/smb.service.
[root@hds var]# smbclient //192.168.126.166/administration_share -U tom
所有用户都登录一遍,检测用户的权限。
上一篇:u盘设置功能在哪里
下一篇:安卓系统微信不能发语音