Updated to disabled root
This commit is contained in:
9
setup.sh
9
setup.sh
@@ -48,4 +48,13 @@ echo "Configuring firewall..."
|
|||||||
ufw allow OpenSSH
|
ufw allow OpenSSH
|
||||||
ufw --force enable
|
ufw --force enable
|
||||||
|
|
||||||
|
# === HARDEN SSH: Disable root login via SSH ===
|
||||||
|
echo "Disabling root SSH login..."
|
||||||
|
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
|
||||||
|
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
|
||||||
|
systemctl restart ssh || service ssh restart
|
||||||
|
|
||||||
|
# === ENSURE beer CAN USE SUDO ===
|
||||||
|
usermod -aG sudo beer
|
||||||
|
|
||||||
echo "Setup complete! You can now SSH into the container/VM as '$USERNAME'."
|
echo "Setup complete! You can now SSH into the container/VM as '$USERNAME'."
|
||||||
|
|||||||
Reference in New Issue
Block a user