Chinaunix

标题: 怎样可以使SSH自动记住密码? [打印本页]

作者: oychw    时间: 2006-06-29 14:30
标题: 怎样可以使SSH自动记住密码?
各位大侠,我的AS4装了KeyChain确无法记住密码,就是SSH一台电脑,下次再ssh 仍然需要密码,怎么实现下次不用输密码阿,谢谢!
root@172.19.152.144's password:
Last login: Thu Jun 29 14:19:08 2006 from 10.50.44.89

KeyChain 2.6.2; http://www.gentoo.org/proj/en/keychain/
Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL

* Found existing ssh-agent (3145)
* Known ssh key: /root/.ssh/id_dsa

-bash: /root/.ssh-agent: 没有那个文件或目录

                                                     [root@sz-ms-meil-linux ~]#
[root@sz-ms-meil-linux ~]#
作者: 寂寞烈火    时间: 2006-06-29 15:25
用SSH的代理
作者: boyhyc    时间: 2006-06-29 15:39
密匙
作者: 给个理由先    时间: 2006-06-29 16:05
我用putty,先生成公药和私药,私药找个目录放下,公约上传到远程指定目录。

再用下面命令登录,在putty中保存当次会话,下次直接在putty开始选下就行了。。。
D:\putty\putty.exe -i  D:\putty\mykeys\all-ssh-private.ppk root@192.168.168.29

putty的help第8章有详细步走说明。。。。
作者: uuhs_hiei    时间: 2006-06-29 16:19
楼上正解,但个人不推荐用,不安全
作者: 给个理由先    时间: 2006-06-29 16:28
原帖由 uuhs_hiei 于 2006-6-29 16:19 发表
楼上正解,但个人不推荐用,不安全



那你说啥个安全?密码吗?还是断网最安 全:em11:
作者: yjd333    时间: 2006-06-29 17:14
我用这个pietty0327有保存功能好像。
作者: oychw    时间: 2006-06-29 18:49
密钥是可以的,但是一般的有个scp的过程,以前好像看别人做过,只要登陆一次就把密码记住了。

比如实验室有很多linux的电脑,我只需要登陆上一台,由它ssh到其他电脑就不需要密码.

但是我这里却是这样一个结果
Last login: Thu Jun 29 15:12:34 2006 from 10.50.44.89

KeyChain 2.6.2; http://www.gentoo.org/proj/en/keychain/
Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL

* Found existing ssh-agent (3145)
* Known ssh key: /root/.ssh/id_dsa

-bash: /root/.ssh-agent: 没有那个文件或目录
[root@sz-ms-meil-linux ~]# ls
anaconda-ks.cfg                firefox-1.5-0.fc4.x86_64.log.gz   openssh-askpass-3.9p1-8.RHEL4.1.i386.rpm
Desktop                        firefox-1.5-0.fc4.x86_64.rpm      openssh-askpass-gnome-3.5p1-6.i386.rpm
firefox-1.5.0.4.tar            install.log                       openssh-askpass-gnome-3.9p1-8.RHEL4.1.i386.rpm
firefox-1.5.0.4.tar.gz         install.log.syslog                openssh-clients-3.5p1-6.i386.rpm
firefox-1.5-0.fc4.i386.log.gz  keychain-2.6.2-1.noarch.rpm       openssh-clients-3.9p1-8.RHEL4.1.i386.rpm
firefox-1.5-0.fc4.i386.rpm     openssh-3.5p1-6.i386.rpm          openssh-server-3.5p1-6.i386.rpm
firefox-1.5-0.fc4.ppc.log.gz   openssh-3.9p1-8.RHEL4.1.i386.rpm  openssh-server-3.9p1-8.RHEL4.1.i386.rpm
firefox-1.5-0.fc4.ppc.rpm      openssh-askpass-3.5p1-6.i386.rpm
[root@sz-ms-meil-linux ~]# ssh 10.50.100.141----------第二次登陆仍然需要密码,是不是Enter passphrase for key '/root/.ssh/identity': 相关的问题呢?
Enter passphrase for key '/root/.ssh/identity':
root@10.50.100.141's password:
Permission denied, please try again.
root@10.50.100.141's password:
[root@ME_100_141 root]# exit
logout

























Connection to 10.50.100.141 closed.
[root@sz-ms-meil-linux ~]# ssh 10.50.100.141
Enter passphrase for key '/root/.ssh/identity':
root@10.50.100.141's password:
作者: 顽主    时间: 2006-07-06 10:56
标题: 用ssh-keygen
ssh-key-gen -t rsa
生成密钥,拷贝到目标主机的/root/.ssh/authorized_keys
就ok
作者: 5iwww    时间: 2006-07-06 14:00
远古帖......
作者: yindows    时间: 2006-07-06 15:26
原帖由 顽主 于 2006-7-6 10:56 发表
ssh-key-gen -t rsa
生成密钥,拷贝到目标主机的/root/.ssh/authorized_keys
就ok

正解,注意用户名即可
推荐看一下q1208c 的贴子,写得已经挺清楚的了
http://bbs.chinaunix.net/viewthread.php?tid=343905




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2