LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 713|回复: 3

请教ssh自动登陆

[复制链接]
发表于 2007-1-13 11:34:05 | 显示全部楼层 |阅读模式
每次远程登陆服务器的时候,都要先ssh user@10.3.3.3然后,输入用户和长长的密码。
觉得很麻烦。想写一个脚本,自动用该脚本里面的用户和密码登陆。
在此请教了
发表于 2007-1-13 20:45:47 | 显示全部楼层
不用这么麻烦啦,设置无密码的ssh登陆就可以了。
man 一下ssh, 搜索 without giving the password.
回复 支持 反对

使用道具 举报

发表于 2007-1-14 01:12:17 | 显示全部楼层
有命令的,直接搞就行了了.
回复 支持 反对

使用道具 举报

发表于 2007-1-15 07:54:23 | 显示全部楼层
If u r using ssh version 2, run ssh-keygen -t rsa on local machine, it will generate two files id_rsa and id_rsa.pub in your $HOME/.ssh folder by default.
It will also ask u to input the passphase, the default is empty.
On the remote side, copy the content of id_rsa.pub into $HOME/.ssh/authorized_keys2
Then u can just write an easy shell script to connect. When u run this shell script no password would be asked.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表