-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
42 lines (31 loc) · 741 Bytes
/
setup.sh
File metadata and controls
42 lines (31 loc) · 741 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y auto-apt-proxy
apt-get -y upgrade
apt-get -y dist-upgrade
apt-get install -y \
nvidia-driver-565-server-open \
nvidia-fabricmanager-565 \
;
# USER CHANGES HERE
# Disable root ssh, and console access
rm /etc/ssh/sshd_config.d/*
usermod -p '!' root
# Do basic cleanup (virt-sysprep can be used to further shrink the image) and
# remove per-machine state.
apt-get clean
printf 'uninitialized\n' >/etc/machine-id
cloud-init clean --logs
shopt -s dotglob
rm -rf \
/tmp/* \
/var/tmp/* \
\
/etc/hostname \
/etc/machine-info \
/etc/ssh/ssh_host* \
/var/lib/dbus/machine-id \
/var/lib/systemd/random-seed \
;