dash (Debian's /bin/sh) doesn't support echo's -e flag: it prints "-e" literally as text before processing the rest of the string's backslash escapes. Every script's colored banner was affected. printf's escape handling is POSIX-mandated and behaves identically under dash and bash, so swap all 90 echo -e calls for printf, appending the trailing \n that echo used to add implicitly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
27 lines
671 B
Bash
Executable File
27 lines
671 B
Bash
Executable File
#!/bin/sh
|
|
|
|
|
|
printf '\033[35m
|
|
__________ __ __
|
|
/ ___/ ___// / / /
|
|
\__ \\__ \/ /_/ /
|
|
___/ /__/ / __ /
|
|
/____/____/_/ /_/
|
|
\033[0m\n'
|
|
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "Please run as root"
|
|
exit
|
|
fi
|
|
|
|
# sed -i 's/PermitRootLogin\ yes/PermitRootLogin no/g' /etc/ssh/sshd_config
|
|
# sed -i 's/PermitEmptyPasswords\ yes/PermitEmptyPasswords no/g' /etc/ssh/sshd_config
|
|
# sed -i 's/Protocol\ [0-9]/Protocol 2/g' /etc/ssh/sshd_config
|
|
|
|
touch /etc/ssh/sshd_config.d/custom.conf
|
|
echo "PermitRootLogin no" >> /etc/ssh/sshd_config.d/custom.conf
|
|
echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config.d/custom.conf
|
|
|
|
systemctl reload ssh
|
|
printf "\033[92;1mSSH secured\033[Om\n"
|