1. 老用户改名
usermod -l new_name old_name sed -i 's/old_name/new_name/' /etc/samba/smb.conf grep old_name /etc/samba/smb.conf smbpasswd -a new_name systemctl restart smb
2. 新添加用户
新建用户
useradd new_name -s /sbin/nologin -M -g new_group usermod -a -G new_group old_name usermod -a -G old_group new_name smbpasswd -a new_name systemctl restart smb
用户加入共享目录
修改配置文件/etc/samba/smb.conf
权限从0755改为0775:
create mask 0775
directory mask 0775
添加用户:配置文件中添加新用户
sed -i 's/old_name/old_name,new_name/' /etc/samba/smb.conf
标签:samba,old,name,用户,添加,new,smb From: https://www.cnblogs.com/santia-god/p/17719887.html