Actualiser miscellaneous/secure_ssh.sh
This commit is contained in:
@@ -145,7 +145,7 @@ PasswordAuthentication no
|
|||||||
HostKey /etc/ssh/ssh_host_ed25519_key
|
HostKey /etc/ssh/ssh_host_ed25519_key
|
||||||
HostKey /etc/ssh/ssh_host_rsa_key
|
HostKey /etc/ssh/ssh_host_rsa_key
|
||||||
|
|
||||||
# Restrict root access
|
# Restrict root access (root will not be able to connect)
|
||||||
PermitRootLogin no
|
PermitRootLogin no
|
||||||
|
|
||||||
# Strict login policy
|
# Strict login policy
|
||||||
@@ -190,6 +190,17 @@ detect_service() {
|
|||||||
|
|
||||||
# Main process
|
# Main process
|
||||||
main() {
|
main() {
|
||||||
|
# Warning message before proceeding with the script.
|
||||||
|
echo "Warning: Before running this script, make sure you have created a user and an SSH key in the authorized_keys file."
|
||||||
|
echo "The root user will not be able to connect."
|
||||||
|
|
||||||
|
read -p "Do you want to continue? (yes/no): " CONTINUE
|
||||||
|
|
||||||
|
if [[ ! "$CONTINUE" =~ ^([yY]es|[oO]ui)$ ]]; then
|
||||||
|
echo "Exiting script."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Detect the SSH service
|
# Detect the SSH service
|
||||||
detect_service
|
detect_service
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user