牛下载:绿色软件官方软件免费下载基地!
所在位置:首页 > 新闻资讯 > 快速创建一个可读写的Samba Server的shell脚本

快速创建一个可读写的Samba Server的shell脚本

发布时间:2020-07-07 22:15:50来源:阅读:

把下面的内容保存成一个shell 脚本,运行完就有了一个可读写的samba server

#!/bin/bash
yum install samba samba-common samba-winbind -y
mv /etc/samba/smb.conf /etc/samba/smb.conf.backup

echo "  [global]    " > /etc/samba/smb.conf
echo "          workgroup = PXESERVER   " >> /etc/samba/smb.conf
echo "          server string = Samba Server Version %v " >> /etc/samba/smb.conf
echo "          log file = /var/log/samba/log.%m    " >> /etc/samba/smb.conf
echo "          max log size = 50   " >> /etc/samba/smb.conf
echo "          idmap config * : backend = tdb  " >> /etc/samba/smb.conf
echo "          cups options = raw  " >> /etc/samba/smb.conf
echo "          netbios name = pxe  " >> /etc/samba/smb.conf
echo "          map to guest = bad user " >> /etc/samba/smb.conf
echo "          dns proxy = no  " >> /etc/samba/smb.conf
echo "          public = yes    " >> /etc/samba/smb.conf
echo "          kernel oplocks = no " >> /etc/samba/smb.conf
echo "          nt acl support = no " >> /etc/samba/smb.conf
echo "          security = user " >> /etc/samba/smb.conf
echo "          guest account = nobody  " >> /etc/samba/smb.conf
echo "  [upload]    " >> /etc/samba/smb.conf
echo "          comment = upload    " >> /etc/samba/smb.conf
echo "          path = /home/upload " >> /etc/samba/smb.conf
echo "          read only = no  " >> /etc/samba/smb.conf
echo "          browseable = yes    " >> /etc/samba/smb.conf
echo "          public = yes    " >> /etc/samba/smb.conf
echo "          printable = no  " >> /etc/samba/smb.conf
echo "          guest ok = yes  " >> /etc/samba/smb.conf
echo "          oplocks = no    " >> /etc/samba/smb.conf
echo "          level2 oplocks = no " >> /etc/samba/smb.conf
echo "          locking = no    " >> /etc/samba/smb.conf

mkdir -p /home/upload
chmod -R 0755 /home/upload
chown -R nobody:nobody /home/upload
systemctl restart smb
systemctl enable smb
反对
收藏
  • 热门资讯
  • 最新资讯
  • 应用排行榜
  • 游戏排行榜