Last active
September 24, 2018 18:16
-
-
Save vinhjaxt/8bd5729e10474eeaa085401243242ae7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
rm -rf /home/sambashare | |
mkdir /home/sambashare | |
echo 'Hello' > /home/sambashare/hello.txt | |
sudo yum install samba samba-client samba-common -y | |
sudo service iptables stop | |
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak | |
rm -f /etc/samba/smb.conf | |
wget https://gist.github.com/vinhjaxt/148c47727de5dc9ad5332ed172b899c1/raw/774883da91c0775fa9f48d8f46a7d5edd2383b03/smb.conf --no-check-certificate -O /etc/samba/smb.conf | |
service smb restart | |
sudo chkconfig smb on | |
groupadd GROUP1 | |
groupadd GROUP2 | |
groupadd GROUP3 | |
useradd -G GROUP1 USER1 | |
useradd -G GROUP1 USER11 | |
useradd -G GROUP2 USER2 | |
useradd -G GROUP3 USER3 | |
echo 'USER1:1' | chpasswd | |
echo 'USER11:1' | chpasswd | |
echo 'USER2:1' | chpasswd | |
echo 'USER3:1' | chpasswd | |
(echo 1; echo 1) | smbpasswd -s -a USER1 | |
(echo 1; echo 1) | smbpasswd -s -a USER11 | |
(echo 1; echo 1) | smbpasswd -s -a USER2 | |
(echo 1; echo 1) | smbpasswd -s -a USER3 | |
service smb restart | |
chmod 777 /home/sambashare | |
mkdir /home/sambashare/TM1 | |
mkdir /home/sambashare/TM2 | |
mkdir /home/sambashare/TM3 | |
chown USER1:GROUP1 /home/sambashare/TM1 | |
chown USER2:GROUP2 /home/sambashare/TM2 | |
chown USER3:GROUP3 /home/sambashare/TM3 | |
chmod 770 /home/sambashare/TM* | |
chmod +t /home/sambashare/TM* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment