#!/bin/bash | |
sed -re's/^#?PasswordAuthentication.*/PasswordAuthentication no/g' -i /etc/ssh/sshd_config | |
sed -re's/^#?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/g' -i /etc/ssh/sshd_config | |
sed -re's/^#?PermitRootLogin.*/PermitRootLogin no/g' -i /etc/ssh/sshd_config | |
rm -f /etc/ssh/ssh_host_* | |
test -f /etc/ssh/ssh_host_dsa_key || dpkg-reconfigure openssh-server |