二、使用一个第三方的AMI需要做的一些操作。
1、Disable Password-Based Logins for Root
to disable password-based logins for root,Open the /etc/ssh/sshd_config file with a text editor and locate the following line:
#PermitRootLogin yes
Change the line to:
PermitRootLogin without-password
To randomize the root password, add the following to your boot process:
if [ -f "/root/firstrun" ] ; then
dd if=/dev/urandom count=50|md5sum|passwd --stdin root
rm -f /root/firstrun
else
echo "* Firstrun *" && touch /root/firstrun
fi
2、检查是否有异常的服务
3、检查是否有异常的系统用户
4、检查是否有异常的crontab