# bash scripting untuk daftar nama staff di server ubuntu, create folder,
# buat password user di smb, chown+chmod folder dan listkan ls -l
echo "Selamat Datang Ke Skrip Pendaftaran Staff di NilamFort."
echo -n "Sila masukkan username staff dan tekan [ENTER]: "
read namenilam
echo -n "Sila masukkan unit staff dan tekan [ENTER]: "
read groupnilam
echo
adduser $namenilam
adduser $namenilam $groupnilam
smbpasswd -a $namenilam
mkdir /media/srikandi/data2/$namenilam
chown -R $namenilam:$groupnilam /media/srikandi/data2/$namenilam
chmod -R 0770 /media/srikandi/data2/$namenilam
echo "["$namenilam"]" >>/etc/samba/smb.conf
echo " comment =" $namenilam $groupnilam >>/etc/samba/smb.conf
echo " writable = yes" >>/etc/samba/smb.conf
echo " valid users =@"$groupnilam >>/etc/samba/smb.conf
echo " path = /media/srikandi/data2/"$namenilam >>/etc/samba/smb.conf
echo " create mode = 0660" >>/etc/samba/smb.conf
echo " directory mode = 0770" >>/etc/samba/smb.conf
echo " browsable = no" >>/etc/samba/smb.conf
ls -l /media/srikandi/data2
**jangan lupa chmod +x friends.sh
0 comments:
Post a Comment