tianfen

samba的安装及其使用

参考pdf文档:https://pan.baidu.com/s/1iPJ1iPtNx7ZXNHRurrjfqw

centos7 samba配置
#centos7安装Samba
yum -y install samba samba-client samba-common

#备份配置文件
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

#检查配置
testparm

#添加系统账号
useradd zhanglin

#添加samba账号
pdbedit -a -u zhanglin
baodian_develop

#修改samba账号密码
smbpasswd -a zhanglin
baodian_develop

#显示samba账号
pdbedit -L

#删除samba账号
pdbedit -x -u zhanglin

#设置开机启动
systemctl enable smb.service
systemctl enable nmb.service

#重启smb服务
systemctl restart smb.service
systemctl restart nmb.service

添加samba用户脚本
read -p "please input adduser name:" name
useradd $name
echo baodian_develop | passwd $name --stdin
/usr/bin/expect -c "
spawn /bin/pdbedit -a -u $name
expect {
\"new password:\" {send \"baodian_develop\r\";exp_continue}
\"retype new password:\" {send \"baodian_develop\r\"} }
exit "

 

分类:

技术点:

相关文章:

  • 2021-08-02
  • 2021-08-03
  • 2021-12-02
  • 2021-07-12
  • 2021-11-06
  • 2022-12-23
  • 2021-07-07
  • 2022-03-04
猜你喜欢
  • 2021-11-30
  • 2022-01-09
  • 2021-11-03
  • 2022-02-28
  • 2022-02-10
  • 2021-11-27
  • 2022-01-01
相关资源
相似解决方案