shell实现ssh自动登录远程主机
来源:互联网 发布:矩阵qr分解 given 编辑:程序博客网 时间:2024/05/17 00:10
首先生成一个新的ssh密钥对
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_ras.
Your public key has been saved in id_ras.pub.
The key fingerprint is:
17:ca:c3:37:8f:60:86:42:d0:0d:b7:4d:70:a1:b2:a3 guo@guo
The key's randomart image is:
+--[ RSA 2048]----+
| ...oo.+. |
| ....* |
| o o . . |
| . o + . . |
| + . S + |
| . o o = + |
| E . . |
| |
| |
+-----------------+
当程序询问密码时按【enter】键,表示不设密码,此时会在工作目录中产生私钥,密码文件名为is_rsa,以及公钥文件id_psa.pub。
[guo@guo zuo]$ ls id*id_ras id_ras.pub
接下来把一个公钥复制到远程主机
[guo@guo zuo]$ ssh-copy-id root@222.24.21.61root@222.24.21.61's password:
Now try logging into the machine, with "ssh 'root@222.24.21.61'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
这一次需要输入密码。但是以后就不用再输入密码了。
[接下来执行脚本。[guo@guo zuo]$ cat guossh.sh
#!/bin/sh
ssh root@222.24.21.61
[guo@guo zuo]$ sh guossh.sh
Last login: Sun Nov 13 20:28:30 2011 from 222.24.21.61
[root@guo ~]#
现在已经登录上了。
- shell实现ssh自动登录远程主机
- ssh 远程主机登录
- linux shell ssh实现自动登录,并且执行一些操作并返回到当前主机
- 使用expect工具 用ssh命令自动登录远程主机
- jenkins结合shell实现登录远程主机执行shell脚本
- putty远程登录ssh主机
- 关于ssh远程登录主机
- SSH密钥登录远程主机
- shell脚本实现ssh自动登录
- ssh自动登录主机脚本
- Linux远程主机自动登录
- linux 使用ssh远程登录远程主机
- putty免密码实现自动登录远程主机
- SecureCRT、SSH Secure Shell Client远程登录实现
- 在Shell脚本中通过SSH登录远程主机的一个方法
- ssh自动远程登录ubuntu
- SSH自动认证远程登录
- ubuntu下ssh登录远程主机
- ASP.NET自定义错误页面
- 我的FC15声卡好像出问题了
- NMF
- C语言学习笔记(八)--数组
- SQL数据库字段类型图解
- shell实现ssh自动登录远程主机
- 十月百度,阿里巴巴,迅雷搜狗最新面试十一题
- 子网掩码、IP地址、DNS
- 在首页上看到的一道有趣的题
- 十月下旬腾讯,网易游戏,百度最新校园招聘笔试题集锦
- 教你通透彻底理解:BFS和DFS优先搜索算法
- 使用递归 输出文件树
- 浅谈Javascript面向对象编程
- 登陆csdn 1000次