g=research
for u in t1 t2 t3
do
sudo useradd -d /home/${u} -m ${u} -g ${g}
echo ${u}:${u}123 | sudo chpasswd
echo -ne "${u}123\n${u}123\n" | sudo smbpasswd -a ${u}
done
#delete these users as well as their home directory
for u in t1 t2 t3
do
sudo userdel -r $u 2>/dev/null
done
#configure samba
sudo apt-get install -y samba
cd /etc/samba/
sudo cp smb.conf smb.conf.bak
sudo vim smb.conf
############################
[global]
security = user
[store]
path = /store/public
valid users = @research
browsable =yes
writable = yes
guest ok = no
############################
sudo mkdir -p /store/public
sudo chmod -R 0755 /store/public
sudo chown -R hadoop:research /store/public
sudo service smbd restart