ssh.sh 666 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. echo -e '\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. touch /etc/ssh/sshd_config.d/custom.conf
  17. echo "PermitRootLogin no" >> /etc/ssh/sshd_config.d/custom.conf
  18. echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config.d/custom.conf
  19. systemctl reload ssh
  20. echo -e "\033[92;1mSSH secured\033[Om"