xadmin
password
server
or desktop
as appropriate$ sudo apt upgrade
$ sudo apt update
$ sudo apt install -y build-essential
Insert Guest Additions image
$ sudo mount /dev/cdrom /cdrom
$ sudo sh /cdrom/VboxLinuxAdditions.run
$ sudo reboot
$ sudo adduser <username>
$ sudo adduser <username> sudo
$ logout
Login as just-created user
$ sudo userdel -r xadmin
# Make this better so that it ends up being:
# 127.0.0.1 <hostname> localhost <hostname>.<domain>
$ sudo sed -i.bak -e "s/$(hostname)/<hostname>" /etc/hosts && \
sudo rm /etc/hosts.bak
$ sudo hostnamectl set-hostname <hostname>
$ sudo sed -i.bak -r \
-e 's/127(.\*)localhost/127\1localhost.<domain> localhost/' \
-e 's/127(.\*)<hostname>/127\1<hostname>.<domain> <hostname>/' \
/etc/hosts && rm /etc/hosts.bak
$ echo <FQDN> | sudo tee -a /etc/mailname
Edit /etc/netplan/50-cloud-inityaml:
<adapter>:
dhcp: no
addresses:
- <address>/<cidr>
nameservers:
addresses: [<dns 1>, <dns 2>]
# DO NOT configure a gateway on VMs (not sure why this was)
gateway4: <gw ip>
optional: true
$ sudo netplan --debug try # test config. reverts after a few minutes
$ sudo netplan --debug apply # save config
$ sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure tzdata $
$ wget -O bootstrap.ini https://gist.githubusercontent.com/jbrubake/02d946ba771eab724e226714e3810dde/raw/c4b63275de8787dbd8458a987df1e0fe6c568df8/bootstrap.ini
Edit bootstrap.ini as needed
$ wget -O bootstrap https://raw.githubusercontent.com/jbrubake/bootstrap/master/bootstrap
$ chmod +x boostrap
$ ./bootstrap
$ sudo sed -i.bak -r -e 's/hosts:(.*)files (.*)/hosts:\1files wins \2/' /etc/nsswitch.conf && \
sudo rm /etc/nsswitch.conf.bak
$ sudo systemctl disable smbd # Unless the machine needs Samba fileshares
$ sudo mkdir /usr/local/share/repository
$ printf "%s\n%s" '# Local repository' 'deb [trusted=yes] file:/usr/local/share/repository ./' | sudo tee -a /etc/apt/sources.list >/dev/null
Add non-free repositories NOTE: this needs fixed
$ sudo sed -i.bak -e 's/restricted/non-free restricted/' /etc/apt/sources.list && \
sudo rm /etc/apt/sources.list.bak
$ sudo apt install -y manpages-posix manpages-posix-dev
INSTRUCTIONS
$ sed -i.bak -e 's/# PermitRootLogin.*/PermitRootLogin no/' \
-e 's/# PaswordAuthentication.*/PasswordAuthentication no/' \
-e 's@# Banner none@Banner /etc/issue.net@ \
/etc/ssh/sshd_config && rm /etc/ssh/sshd_config.bak
$ apt install cifs-utils # Needed to mount share
$ apt install smbclient # Helpful for troubleshooting
$ mkdir /mnt/<mountpoint>
$ chmod 755 /mnt/<mountpoint>
$ echo '//<host>/<share> <mountpoint> cifs noauto,user,credentials=<credsfile>,uid=<username>,gid=<username>,dir_mode=0775,file_mode=0664 0 0' >> /etc/fstab
$ cat << END > <credsfile>
> username=<username>
> password=<password>
> END
$ chmod 600 <credsfile>