-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdropbox_setup.sh
75 lines (58 loc) · 1.75 KB
/
dropbox_setup.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
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
username=pentest
#dropbox username
#echo "Please enter dropbox username! (usually kali or pentest)"
#read username
#echo "USERNAME = $username"
echo "Set new sudo password for $username user before running this script!"
sleep 1
#Sudo Check
if [ `id -u` -eq 0 ]
then
echo "Running as user with sudo privs :)"
else
echo "Please run with standard (NON ROOT) user and sudo!"
exit 1
fi
echo "Disabling Sleep"
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
echo "Please enter the machine name which is also the name of the openvpn file without the extension"
read -p 'Hostname: ' hostname
filename=$hostname.ovpn
# if ovpn file does not exist then exit
if [ ! -f /home/pentest/$filename ]
then
echo "$filename not found. Exiting!"
exit 1
else
echo "File found. Copying now..."
fi
sudo cp /home/pentest/$filename /etc/openvpn/openvpn.conf
#sudo rm /opt/openvpn/*
sudo systemctl enable openvpn
echo "Copied and enabled dropbox openvpn file!"
sudo rm /home/pentest/$filename
#echo "Please enter new hostname (companyname):"
#read hostname
sudo hostnamectl set-hostname $hostname
sed -i "s/127.0.1.1.*/127.0.1.1\t$hostname/g" /etc/hosts
echo "Hostname set to $hostname"
echo "UPDATING"
sudo apt update && sudo apt upgrade -y
echo "Installing and enabling RDP"
sudo apt install xrdp -y
service xrdp start
service xrdp-sesman start
update-rc.d xrdp enable
echo "Enabling SSH"
sudo systemctl enable ssh.service
systemctl start ssh.service
echo "Enabling NTP"
sudo timedatectl set-timezone America/New_York
sudo systemctl enable ntp.service
sudo systemctl start ntp.service
echo "Cleaning Up..."
sudo apt autoclean
sudo apt -y autoremove
echo "RECOMMEND REBOOT AFTER SCRIPT FINISHES……"
sleep 3