SSH配置规范
SSH服务安装
安装ssh服务
sudo apt-get update
sudo apt-get install ssh
修改sshd_config配置
sOldPasswordAuthentication="#PasswordAuthentication no"
sNewPasswordAuthentication="PasswordAuthentication yes"
sOldPermitRootLogin="#PermitRootLogin prohibit-password"
sNewPermitRootLogin="PermitRootLogin yes"
sed -i "s/${sOldPasswordAuthentication}/${sNewPasswordAuthentication}"/g /etc/ssh/sshd_config
sed -i "s/${sOldPermitRootLogin}/${sNewPermitRootLogin}"/g /etc/ssh/sshd_config
启动ssh服务
/etc/init.d/ssh start
service ssh start
验证ssh服务状态
/etc/init.d/sshd status
设置开机自启
update-rc.d ssh enable
|