A list of the first commands I run on a new Debian LXC to homogenize and secure my new environment.
apt update && apt upgrade -y
apt install curl nano openssl rsync sudo -y
Don’t use root
It is critical that you don’t use root for SSH or for typical CLI tasks. I always create a new user for that reason.
useradd -m -g users -G sudo patrick
chsh -s /bin/bash patrick
I always disallow login for root over SSH and allow password logins for other users. To do this, edit
/etc/ssh/sshd_config. You’re looking to uncomment and modify the following lines:
# To disable tunneled clear text passwords, change to no here!
Once you’ve made the changes, you can restart the LXC and use SSH with your new user.