Ubuntu Server - VM
π Resources π
Create a new Virtual Machine in VMWare with preferred specs:
Processors:
1 CPU - 2 Coresenable
Virtualize Intel VT-x/EPT or AMD-V/RVI
RAM Memory:
2 GBHard Disk:
15 GBCD: use the Ubuntu Server LTS .iso image file - Download here - and check Connect at power on
Network: set it as
NATDisplay: Deactivate
Accelerate 3D graphicsEdit virtual machine and Remove:
Printer
Boot the virtual machine and proceed with the Ubuntu Server Installation


Installation Process
Boot to
Try or Install Ubuntu ServerChoose the language
Update to the new installer(if offered)Select keyboard layout
Select
Ubuntu Serveras base for the installWait for Network connection to establish via DHCP (continue without networking if this fails)
Do not configure a proxy
Leave Ubuntu archive mirror as it is (or change based on necessity)
For storage, leave
Use an entire diskchecked, and choose a disk to install toEdittheubuntu-lvlogical volume by assigning it the max size
Select
Doneon the configuration screen and confirm the installEnter a username, hostname and password
Skip for nowthe Ubuntu Pro upgradeOn the SSH Setup, check the
Install OpenSSH server, selectDonefor the next 2-3 slidesSelect
Reboot
First Boot & Update
Disable CD Connect at power on
Boot Ubuntu Server
Connect through SSH and/or Run the following commands
Reboot the system
Configurations
SSHinto the VM
Bash aliases or ZSH
Follow the guide here to setup
ZSHwithOh-My-Zsh- Zsh & Oh-My-Zsh - syselementRemove unwanted spam with UnspamifyUbuntu - Github Skyedra
Expand Partition and Filesystem
Turn off the VM, increase disk space on the hypervisor, turn on the VM
Proceed with expanding the necessary partition on the server
Network
Static IP
Set a static IP in the netplan
.yamlif not configured during OS installation.
If necessary and the VM has 2 NICs, add the seccond one in the netplan
.yaml
Tuning
Basic Tools
Alternative to install Docker Engine (via APT)
ctop - concise commandline monitoring for containers
Hardening
SSH-key-based authentication
Ubuntu Server with OpenSSH pre-installed comes with PasswordAuthentication yes parameter already set inside /etc/ssh/sshd_config.d/50-cloud-init.conf (or /etc/ssh/sshd_config). If the parameter is commented, the default is yes (password auth permitted) for the sshd_config.
Generate an SSH Key Pair on the local HOST from which the connection is established
Add the Public Key to a system/sudo user on the Ubuntu Server VM
If you want to use the same key saved on Github profile, having already the private key in the Ubuntu Local HOST (commands above), ssh into the Ubuntu Server VM and use the following commands:
Log out and log in using the Private Key
Disable SSH password authentication
Test SSH access (on the new port if changed) before closing the current session
Only SSH-key-base authentication is permitted
SSH-Hardened configuration
e.g. 10-hardening.conf file:
... more to come ...
Last updated