SSH无密码登录脚本
2014-05-06 11:26
260 查看
#!/bin/bash file="/root/.ssh/authorized_keys" sed -i "s/#PubkeyAuthentication/PubkeyAuthentication/g" /etc/ssh/sshd_config sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config sed -i "s/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g" /etc/ssh/sshd_config sed -i "s/#UseDNS yes/UseDNS no/g" /etc/ssh/sshd_config sed -i "s/GSSAPIAuthentication no/GSSAPIAuthentication yes/g" /etc/ssh/sshd_config if [ ! -d "/root/.ssh" ];then mkdir -p /root/.ssh fi if [ ! -f $file ];then \cp authorized_keys /root/.ssh else cat authorized_keys >> $file fi chmod 600 /root/.ssh/authorized_keys service sshd restart
相关文章推荐
- mac 脚本ssh自动密码登录服务器,非公钥
- 定制微型linux实现启用虚拟终端基于帐号密码登录、提供ssh服务,提供Web服务(下)附有命令移植脚本 推荐
- linux ssh无密码登录,远程执行脚本文件
- Linux下实现SSH免密码登录和实现秘钥的管理、分发、部署SHELL脚本分享
- ssh免密码登录脚本
- SSH利用密匙免密码登录脚本
- 大数据IMF 传奇 8台设备如何实现免密码的SSH登录呢 ?脚本分发 解决方案
- Linux下实现SSH免密码登录和实现秘钥的管理、分发、部署SHELL脚本分享
- python批量操作Linux服务器脚本,ssh密码登录(执行命令、上传、下载)(一)
- expect 提供用户名和密码的SSH自动登录脚本
- 脚本自动配置hadoop集群的ssh无密码登录
- python批量操作Linux服务器脚本,ssh密码登录(执行命令、上传、下载)(一)
- 实现ssh登录无须密码的2个脚本
- hadoop中的ssh无密码登录配置