我是靠谱客的博主 开心鸵鸟,最近开发中收集的这篇文章主要介绍sshd_config无密访问的处理,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

#!/bin/bash
ip=$1
currpath=$2
hostip=$3 //本机ip
if [ -z "$hostip" ] || [ "$ip" != "$hostip" ];then
ssh ${ip} $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "AuthorizedKeysFile "
ssh ${ip} $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "RSAAuthentication "
ssh ${ip} $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "PubkeyAuthentication "
ssh ${ip} $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "PasswordAuthentication "
ssh ${ip} $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "PermitEmptyPasswords "
ssh ${ip} $currpath/base/addOrUpdateMark.sh "/etc/ssh/sshd_config" "StrictModes" " " "no"
ssh ${ip} $currpath/base/addOrUpdateMark.sh "/etc/ssh/sshd_config" "GSSAPIAuthentication" " " "no"
ssh root@${ip} /sbin/service sshd restart
else
sh $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "AuthorizedKeysFile "
sh $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "RSAAuthentication "
sh $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "PubkeyAuthentication "
sh $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "PasswordAuthentication "
sh $currpath/base/annotationCol.sh "/etc/ssh/sshd_config" "PermitEmptyPasswords "
#sh $currpath/base/addOrUpdateMark.sh "/etc/ssh/sshd_config" "StrictModes" " " "no"
#sh $currpath/base/addOrUpdateMark.sh "/etc/ssh/sshd_config" "GSSAPIAuthentication" " " "no"
sh /sbin/service sshd restart
fi

最后

以上就是开心鸵鸟为你收集整理的sshd_config无密访问的处理的全部内容,希望文章能够帮你解决sshd_config无密访问的处理所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(35)

评论列表共有 0 条评论

立即
投稿
返回
顶部