-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththis_better_work.sh
62 lines (57 loc) · 1.41 KB
/
this_better_work.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
arg=$1
if [[ $arg = "?" ]]; then
echo "ufw"
echo "passwd"
echo "ftp"
echo "ssh"
# echo "mysql"
fi
# ufw
if [[ $arg = "" ]] || [[ $arg = "ufw" ]]; then
sudo ufw default deny incoming
sudo ufw default allow outgoing
#sudo ufw allow Apache
#sudo ufw allow 'Apache Full'
#sudo ufw allow 'Apache Secure'
#sudo ufw allow CUPS
#sudo ufw allow OpenSSH
#sudo ufw allow Samba
#sudo ufw allow [port]
sudo ufw allow 21/tcp
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 3500/tcp
sudo ufw allow 6697/tcp
#sudo ufw allow from [IP]
sudo ufw enable
fi
# passwd
if [[ $arg = "" ]] || [[ $arg = "passwd" ]]; then
echo vagrant
sudo passwd
echo artoo_detoo
sudo passwd artoo_detoo
echo boba_fett
sudo passwd boba_fett
fi
# ftp
if [[ $arg = "" ]] || [[ $arg = "ftp" ]]; then
sudo service proftpd stop
sudo apt install vsftpd
echo -e "vagrant\nartoo_detoo" | sudo tee /etc/vsftpd.userlist
sudo update-rc.d proftpd disable
fi
# ssh
if [[ $arg = "" ]] || [[ $arg = "ssh" ]]; then
sudo mv /etc/ssh/sshd_config /etc/ssh/sshd_config.old
sudo cp sshd_config /etc/ssh/
sudo service ssh restart
sudo service ssh status
fi
# mysql
# if [[ $arg = "" ]] || [[ $arg = "mysql" ]]; then
# sudo mysql
# ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_strong_password';
# FLUSH PRIVILEGES;
# fi