Add enable SSH on a pve lxc

This commit is contained in:
Christopher
2023-09-23 10:55:31 -05:00
parent 360f7b1bba
commit ed2495c312
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# SSH Root Login Enabler Script
## Overview
This shell script is designed to set up a root password and enable SSH root login on a Linux system. `Please note that enabling SSH root login can be a security risk. Use this script only if you understand the implications.`
## Prerequisites
- The script must be run on a Linux system.
- The script must be run as the root user.
## How to use?
```bash
bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/enable-ssh-on-pve-lxc/disable_dns_service.sh)"
```

View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Check for root privileges
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
exit 1
fi
# Set the root password
echo "Setting up root password..."
passwd root
# Enable SSH root login
echo "Enabling SSH for root..."
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# Restart the SSH service
echo "Restarting SSH service..."
systemctl restart sshd
echo "Done!"