我已经使用KVM安装了Snappy Ubuntu Core Alpha,但是无法使用SSH连接到它。
SSH返回ssh_exchange_identification: read: Connection reset by peer
,这似乎是映像上的服务器端错误。
主机系统是Ubuntu 14.10 Desktop。
安装说明:http : //blog.dustinkirkland.com/2014/12/its-a-snap.html
$ sudo apt-get install kvm
$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
$ wget http://cdimage.ubuntu.com/ubuntu-core/preview/ubuntu-core-alpha-01.img
$ kvm -redir :2222::22 -redir :4443::443 ubuntu-core-alpha-01.img
该映像似乎正在运行:预期的QEMU窗口打开,“正在从磁盘引导...”。QEMU进程开始首先使用CPU和MEM。QEMU开始在适当的端口上侦听:
$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:2222 0.0.0.0:* LISTEN 11303/qemu-system-x
[...]
tcp 0 0 0.0.0.0:4443 0.0.0.0:* LISTEN 11303/qemu-system-x
[...]
$
没有防火墙规则会阻止主机上的端口22、443、2222或4443:
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
ACCEPT udp -- anywhere anywhere udp dpt:bootps
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
在另一个终端窗口中,我尝试ssh进入Snappy Ubuntu Core系统:
$ ssh -vv -p 2222 ubuntu@localhost
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 2222.
debug1: Connection established.
debug1: identity file /home/ian/.ssh/id_rsa type 1
debug1: identity file /home/ian/.ssh/id_rsa-cert type -1
debug1: identity file /home/ian/.ssh/id_dsa type 2
debug1: identity file /home/ian/.ssh/id_dsa-cert type -1
debug1: identity file /home/ian/.ssh/id_ecdsa type -1
debug1: identity file /home/ian/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/ian/.ssh/id_ed25519 type -1
debug1: identity file /home/ian/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-8
ssh_exchange_identification: read: Connection reset by peer
$
我做错了吗?还是这可能是一个错误?
感谢#snappy IRC中的专家,他找到了答案。
首先,快照映像需要64位主机。我的主机正在运行32位,因此QEMU可以加载映像,但无法运行。当前,尚未构建Snappy Ubuntu Core的32位版本。
如果我一直在使用64位主机,则在ssh密钥生成之前,期间或期间停止KVM时,可能会发生类似情况。两种可能的解决方案:1)下载新映像,或2)通过控制台登录(而不是ssh)并删除/etc/ssh/*host*
文件。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句