同样,我有一个关于ssh问题的问题:
在嵌入式系统(没有显示,没有键盘)上,我唯一的登录界面是ssh。Telnet也被禁用了。(我目前正试图使它充满希望.)
我目前唯一的交互就是接收一个ping答案,并通过smb://浏览我的共享文件!
ssh的回答总是:
$ ssh -vvvvl root 192.168.0.3
OpenSSH_5.5p1 Debian-4ubuntu4, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.3 [192.168.0.3] port 22.
debug1: Connection established.
debug1: identity file /home/simon/.ssh/id_rsa type -1
debug1: identity file /home/simon/.ssh/id_rsa-cert type -1
debug1: identity file /home/simon/.ssh/id_dsa type -1
debug1: identity file /home/simon/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3p2 Debian-8
debug1: match: OpenSSH_4.3p2 Debian-8 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-4ubuntu4
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer但是,我通过从设备中取出硬盘并在其连接到另一台计算机时对其上的文件进行操作,从而直接访问hdd。
在我注销并被锁定之前,我的最后一步是sudo rm /etc/ssh/*host*key*,然后是dpkg-reconfigure openssh-server,由于找不到dpkg-reconfigure,所以失败了。所以我想问题是,键被删除了,。
我现在的问题是:在没有在目标系统上运行任何命令的情况下,如何在离岸创建密钥并将它们提供给sshd,或者如何使sshd允许我在没有密钥的情况下登录?
谢谢你的帮助,如果有..?!
发布于 2011-02-03 08:40:30
您可以在方便的Linux系统上生成一组新的主机密钥,如下所示:
ssh-keygen -t rsa -b 2048 -f ssh_host_rsa_key
ssh-keygen -t dsa -b 1024 -f ssh_host_dsa_key当ssh-keygen要求您输入密码时,不要键入任何内容就可以点击Enter。主机密钥必须有空密码。
这将在当前目录中创建以下文件:
ssh_host_rsa_key
ssh_host_rsa_key.pub
ssh_host_dsa_key
ssh_host_dsa_key.pub然后,您可以挂载设备的硬盘驱动器并将这四个文件复制到etc/ssh中。
请注意,当您以后尝试到系统ssh时,ssh客户端会抱怨密钥与预期不同,并且可能拒绝连接。如果您正在运行OpenSSH客户端,则可以再次使用ssh-keygen纠正此问题:
ssh-keygen -R <your_server_hostname>发布于 2011-02-03 07:40:48
ssh -vvvvl根192.168.0.3
应:
ssh -vvvvl root@192.168.0.3
我不知道这是您在堆栈溢出发布时所做的错误,还是您在命令行中输入的错误。
https://stackoverflow.com/questions/4883464
复制相似问题