Centos_samba_login.sh

#!/bin/bash
#Centos_samba_login.sh
#需要帐户登陆共享
echo "[global]

workgroup       = Workgroup
netbios name    = Cgate
server string   = Samba Server Version %v
unix charset    = utf8
display charset = utf8
dos charset     = cp950
log file        = /var/log/samba/log.%m
max log size    = 50
load printers   = No
security        = share
load printers   = no
security        = user
passdb          = tdbsam

[homes]
comment         = Home Directories
writable        = yes
browseable      = no
create mode     = 0664
directory mode  = 0775

[project]
comment         = smbuser's project
path            = /home/project
browseable      = yes
writable        = yes
write list      = @users " >/etc/samba/smb.conf

mkdir /home/project
chgrp users /home/project
chmode 2770 /home/project
useradd -G users smb1
useradd -G users smb2
useradd -G users smb3
echo 1234 | passwd --stdin smb1
echo 1234 | passwd --stdin smb2
echo 1234 | passwd --stdin smb3
pdbedit -a -u smb1
pdbedit -a -u smb2
pdbedit -a -u smb3
service smb restart
service nmb restart

你可能感兴趣的:(Bash)