Kvm启动ubuntu虚拟机无法ssh

原创 2016年05月31日 17:57:50

1. ssh:Connection refused

1) ssh 120.0.0.11 Connection refused

root@node2:/opt/zq# ssh ubuntu@120.0.0.11
ssh: connect to host 120.0.0.11 port 22: Connection refused

2. ubuntu虚拟机安装openssh-server

1) apt-get安装,如果提示无法安装,找不到源,那么apt-get update

apt-get install openssh-server      

2) 如果,更新源还是不可以,则修改源路径:

vi /etc/apt/sources.list

修改如下:

deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

3. WARNING: IDENTIFICATION HAS CHANGED!

1) ssh远程无法登陆,提示验证。首先确保登录用户为root权限。

root@node2:/opt/zq# ssh 120.0.0.11
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
a1:d1:fe:08:87:87:e0:0f:64:d1:fa:0b:7a:28:09:78.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:37
  remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R 120.0.0.11
ECDSA host key for 120.0.0.11 has changed and you have requested strict checking.
Host key verification failed.

2) 开启ssh远程权限

 vi /etc/ssh/ssh_config 

ubuntu版本不同该文件有所区别:
http://blog.csdn.net/qiqishuang/article/details/51547884
修改如下:

Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
   PasswordAuthentication no
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no

3) 依然无法登陆,则有以下几种解决方案:

  • Just delete the known_hosts file If you have only used one ssh server
mv /root/.ssh/known_hosts /tmp

4. ssh正确登陆姿势

1) 不正确姿势:ssh 120.0.0.11

root@node2:/opt/zq# ssh 120.0.0.11
The authenticity of host '120.0.0.11 (120.0.0.11)' can't be established.
ECDSA key fingerprint is a1:d1:fe:08:87:87:e0:0f:64:d1:fa:0b:7a:28:09:78.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '120.0.0.11' (ECDSA) to the list of known hosts.
root@120.0.0.11's password: 
Permission denied, please try again.
root@120.0.0.11's password: 
Permission denied, please try again.
root@120.0.0.11's password: 
Permission denied (publickey,password).

2) 正确姿势:ssh ubuntu@120.0.0.11

root@node2:/opt/zq# ssh ubuntu@120.0.0.11
ubuntu@120.0.0.11's password: 
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-25-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Tue May 31 02:59:19 EDT 2016

  System load: 0.22              Memory usage: 3%   Processes:       83
  Usage of /:  5.0% of 17.34GB   Swap usage:   0%   Users logged in: 0

  Graph this data and manage this system at:
    https://landscape.canonical.com/

0 packages can be updated.
0 updates are security updates.

Last login: Tue May 31 02:59:19 2016
版权声明:本博客为博主原创博文,可以任意转载。转载请附上博客链接: http://blog.csdn.net/qiqishuang

Kvm启动ubuntu虚拟机无法联网

1. kvm是否启动镜像1) 现象:kvm启动qcow2 ubuntu虚拟机过程中,提示 error were found when checking the disk drive for boot ...

Ubuntu12.10 下搭建基于KVM-QEMU的虚拟机环境(七)

qemu编译出来以后,其实就已经可以做一些虚拟机的使用体验了,因此在继续下一步之前,我们先小小的体验一下,感受一下创建和使用虚拟机的乐趣。 一.创建镜像文件 我们平常装在PC上的操作系统是驻留在硬...

【转】Ubuntu 12.04 KVM+Qemu 搭建虚拟机

Quoted from http://www.linuxidc.com/Linux/2012-05/60705.htm NOTE:我的主机是Ubuntu 12.04 Desktop i386 ...

基于ubuntu server 16.04环境安装kvm虚拟机并创建windows系统

由于项目需要,最近在研究kvm虚拟机,将这个过程中遇到的一些问题做一些记录。由于本人水平有限,其中不妥之处还请网友们不吝赐教!!   1.操作环境   ubuntu server 16.04 ...

ubuntu12.04环境下使用kvm ioctl接口实现最简单的虚拟机

英文原文:https://lwn.net/Articles/658511/。本文在翻译的基础上加了一些自己的理解。 qemu、virtual box、vmware、xen都是虚拟机,一般用户接触到...
  • ayu_ag
  • ayu_ag
  • 2016年10月13日 16:01
  • 3016

Ubuntu12.10 下搭建基于KVM-QEMU的虚拟机环境(十)

在Ubuntu12.10 下搭建基于KVM-QEMU的虚拟机环境(九)中我们用libvirt定义创建、启动和使用了基本的虚拟机过程。今天开始我们通过对XML的更多tag的改变来尝试更多新的功能。   ...

Ubuntu12.10 下搭建基于KVM-QEMU的虚拟机环境(十九)

Spice 客户端和spice 服务端通常运行在不同的机器上,运行spice服务端的主机通常有着多颗多核的CPU以及几十G以上的内存,通过底层支持虚拟化的KVM+qemu环境虚拟出几台到几十台虚拟机,...

Ubuntu+VNC+KVM虚拟机安装部署说明文档

Ubuntu+VNC+KVM虚拟机安装部署说明文档 1. 安装ubuntu和镜像源 1.1 安装Ubuntu Server版 注意版本: Ubuntu 12.04.4 LTS (GNU/Lin...
  • haili88
  • haili88
  • 2015年09月12日 20:52
  • 501

Ubuntu 下安装kvm, qemu, libvirt,并新建虚拟机的过程

需要一台远程服务器,通过virt-manager进行远程连接。 首先记录一下版本号,测试通过的版本是: Ubuntu 13.04, Qemu 1.4.0, libvirt 1.1.2 ...

Ubuntu12.10 下搭建基于KVM-QEMU的虚拟机环境(十八)

到目前为止,我们用spice 客户端连接虚拟机的命令如下: dev@devhost:/opt/vm# sudo spicec –h 127.0.0.1 –p 4000      //127.0.0...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Kvm启动ubuntu虚拟机无法ssh
举报原因:
原因补充:

(最多只允许输入30个字)