ssh.sh 478 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. echo '\033[35m
  3. __________ __ __
  4. / ___/ ___// / / /
  5. \__ \\__ \/ /_/ /
  6. ___/ /__/ / __ /
  7. /____/____/_/ /_/
  8. \033[0m'
  9. if [ "$EUID" -ne 0 ]; then
  10. echo "Please run as root"
  11. exit
  12. fi
  13. sed -i 's/PermitRootLogin\ yes/PermitRootLogin no/g' /etc/ssh/sshd_config
  14. sed -i 's/PermitEmptyPasswords\ yes/PermitEmptyPasswords no/g' /etc/ssh/sshd_config
  15. sed -i 's/Protocol\ [0-9]/Protocol 2/g' /etc/ssh/sshd_config
  16. systemctl reload ssh
  17. echo "\033[92;1mSSH secured\033[Om"