shell脚本部署无密码访问
lyongq04
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
expect执行ssh-keygen
#!/bin/bash echo "===========genrsa====================" expect原创 2016-05-10 17:47:15 · 718 阅读 · 0 评论 -
expect执行ssh-copy-id
#!/bin/bash ip=$1 uname=$2 password=$3 filepath=/usr/$uname/.ssh/id_rsa.pub if [ $uname = "root" ];then filepath=/root/.ssh/id_rsa.pub fi echo "===========resrsa====================" expect...原创 2016-05-10 17:47:36 · 322 阅读 · 0 评论 -
shell新增用户
#!/bin/bash gname=$1 uname=$2 password=$3 echo "==========$gname,$uname,$password======" #userdel $uname isUserExist=` cat /etc/passwd|grep $uname|wc -l ` isGroupExist=` cat /etc/group|grep $gn...原创 2016-05-10 17:49:17 · 293 阅读 · 0 评论 -
sed给行前面加入‘#’号
#!/bin/bash filename=$1 key=$2 #sed -i '2,5s/'"$key"'.*/#/' $filename sed -i 's/^'"$key"'/#&/' $filename原创 2016-05-10 18:00:21 · 2895 阅读 · 0 评论 -
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 ${i...原创 2016-05-10 18:04:28 · 354 阅读 · 0 评论 -
shell脚本部署无密码访问
为了实现一些组件的自动化部署,可能要设置服务器的免密访问比较方便,最后实现了自动化部署密码脚本,以下为实现代码逻辑。代码比较庞大,不能一一道出了。 #!/bin/bash ips=( '10.100.112.79' '10.100.112.203' '10.100.112.204' '10.100.112.205' '10.100.112.95' '10.100.112.125' ) //...原创 2016-05-11 22:56:54 · 226 阅读 · 0 评论
分享