OS Prep: Users, Packages, and SSH
Ubuntu OS setup
Table of contents
- Source
- Create new user and give sudo privileges
- Update Ubuntu OS
- Install basic and required packages
- Change SSH port to 2053
- Check our work
Source
These steps are based on Anand’s OS setup guide at Ultimate Docker Server: Getting Started with OS Preparation Part 1.
-
The steps below are adapted from this guide to match Ubuntu 24.04 SSH requirements.
-
These steps will prepared us to install Docker later using Anand’s excellent SimpleHomelab Deployarr application.
Do
Create new user and give sudo privileges
adduser kurt
adduser kurt sudo
Update Ubuntu OS
sudo apt update
sudo apt upgrade
Install basic and required packages
sudo apt install sudo linux-generic ca-certificates curl gnupg lsb-release ntp htop zip unzip gnupg apt-transport-https ca-certificates net-tools ncdu apache2-utils git neofetch vsftpd mc
linux-generic
is required to enable GPU passthrough from Proxmox to the Ubuntu VM. It is not included in the Ubuntu Cloud-Init distribution used by the Tteck Ubuntu installation script.
Change SSH port to 2053
These instructions are different than what is on Anand’s site due to changes in Ubuntu 24.04 SSH.
Change systemd
configuration for ssh.socket
To change the port of the SSH server, the systemd configuration for ssh.socket must be changed or supplemented. The configuration adjustment is made by editing the socket using systemctl
.
-
Edit
ssh.socket
file:systemctl edit ssh.socket
-
Add the following lines at the top under the two initial commented lines:
[Socket] ListenStream= ListenStream=2053
The blank line
ListenStream=
is required to ensure that port 22 is no longer used. Without this line, the SSH server would then be accessible via port 22 (default) and 2053. -
Restart SSH:
systemctl daemon-reload sudo systemctl restart ssh
-
Reboot the VM:
reboot
Check our work
-
Ensure that port 22 is closed and port 2053 is open:
netstat -ant | grep 2053
sudo lsof -nP -iTCP -sTCP:LISTEN
sudo netstat -tunpl
-
SSH
root
check: Log into Ubuntu server using new SSH port 2053ssh root@192.168.1.100 -p 2053
-
SSH
user
check: Log into Ubuntu server using new SSH port 2053ssh kurt@192.168.1.100 -p 2053