-
Notifications
You must be signed in to change notification settings - Fork 187
/
Copy pathroot-bootstrap.sh
57 lines (46 loc) · 1.36 KB
/
root-bootstrap.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
#!/usr/bin/env bash
set -xe
# Create user sdn
useradd -m -d /home/sdn -s /bin/bash sdn
usermod -aG sudo sdn
usermod -aG vboxsf sdn
echo "sdn:rocks" | chpasswd
echo "sdn ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/99_sdn
chmod 440 /etc/sudoers.d/99_sdn
update-locale LC_ALL="en_US.UTF-8"
apt-get update
apt-get install -y --no-install-recommends apt-transport-https ca-certificates
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
# Required packages
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
avahi-daemon \
git \
bash-completion \
htop \
python \
zip unzip \
make \
wget \
curl \
vim nano emacs \
docker-ce
# Enable Docker at startup
systemctl start docker
systemctl enable docker
# Add sdn user to docker group
usermod -a -G docker sdn
# Install pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py --force-reinstall
rm -f get-pip.py
# Bash autocompletion
echo "source /etc/profile.d/bash_completion.sh" >> ~/.bashrc
# Fix SSH server config
tee -a /etc/ssh/sshd_config <<EOF
UseDNS no
EOF
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
# IntelliJ
snap install intellij-idea-community --classic