I can not connect to ssh on VM


(Ulisses Castello) #1

Hi,

I installed a Debian VM through Marketplace, and also attached a network.
Then I added ssh key to the template, but I can not connect to VM with ssh.

[oneadmin @ bravo02 ~] $ ssh root@10.180.0.124
ssh: connect to host 10.180.0.124 port 22: No route to host

[oneadmin@bravo02 ~]$ onevm show 7
VIRTUAL MACHINE 7 INFORMATION
ID : 7
NAME : debian01
USER : oneadmin
GROUP : oneadmin
STATE : ACTIVE
LCM_STATE : RUNNING
LOCK : None
RESCHED : No
HOST : localhost
CLUSTER ID : 0
CLUSTER : default
START TIME : 09/19 10:43:29
END TIME : -
DEPLOY ID : one-7

VIRTUAL MACHINE MONITORING
CPU : 0.0
MEMORY : 768M
NETTX : 23K
NETRX : 0K
DISKRDBYTES : 78321878
DISKRDIOPS : 4643
DISKWRBYTES : 7286784
DISKWRIOPS : 385

PERMISSIONS
OWNER : um-
GROUP : —
OTHER : —

VM DISKS
ID DATASTORE TARGET IMAGE SIZE TYPE SAVE
0 default vda Debian 9 - KVM 320M/2G file NO
1 - hda CONTEXT 1M/- - -

VM NICS
ID NETWORK BRIDGE IP MAC PCI_ID
0 private1 br0 10.180.0.124 02:00:0a:b4:00:7c

SECURITY

NIC_ID NETWORK SECURITY_GROUPS
0 private1 0

SECURITY GROUP TYPE PROTOCOL NETWORK RANGE
ID NAME VNET START SIZE
0 default OUTBOUND ALL
0 default INBOUND ALL

VIRTUAL MACHINE HISTORY
SEQ UID REQ HOST ACTION DS START TIME PROLOG
0 - - localhost none 0 09/19 10:43:30 0d 00h15m 0h00m05s

USER TEMPLATE
INPUTS_ORDER=""
LOGO=“images/logos/debian.png”
MEMORY_UNIT_COST=“MB”

VIRTUAL MACHINE TEMPLATE
AUTOMATIC_DS_REQUIREMENTS="(“CLUSTERS/ID” @> 0)"
AUTOMATIC_REQUIREMENTS="(CLUSTER_ID = 0) & !(PUBLIC_CLOUD = YES)"
CONTEXT=[
DISK_ID=“1”,
ETH0_CONTEXT_FORCE_IPV4="",
ETH0_DNS=“10.180.1.100”,
ETH0_GATEWAY=“10.180.0.2”,
ETH0_GATEWAY6="",
ETH0_IP=“10.180.0.124”,
ETH0_IP6="",
ETH0_IP6_PREFIX_LENGTH="",
ETH0_IP6_ULA="",
ETH0_MAC=“02:00:0a:b4:00:7c”,
ETH0_MASK="",
ETH0_MTU="",
ETH0_NETWORK=“10.180.0.0”,
ETH0_SEARCH_DOMAIN="",
ETH0_VLAN_ID="",
ETH0_VROUTER_IP="",
ETH0_VROUTER_IP6="",
ETH0_VROUTER_MANAGEMENT="",
NETWORK=“YES”,
SSH_PUBLIC_KEY=“ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCcVlk3Lk6JgIuZv0TF6KWDuuS8JB30/mRpgnySHnehEdlQ2AXMghCvt2z3S77HTpy4MQzn6pGAMyQaeAMlXVzLBN9yRj5v3o6DJkYj2bSONMNO9jd8s6h5cK4tuV3Sax7S4eKF0TlsNgsQsNrwhPBeI/pUZivjbD5jxz6HG88tKZP9XUq37cWSGdsSbX5u1mU+EI6+mKaZBNZM3oALDffZaicobCrwSndZVPQDrWAjkTHDGkx/8H1gZXLvcKJcEkHYVt8qBLw+otw43+5Mtgm7wlC6e2KQsSaDM0rJKPjwp2BmgJZY3T8EOMBsRO1pCFWSMk/mz/hrtmZMXP+oJSQz oneadmin@bravo02.iag.usp.br”,
TARGET=“hda” ]
CPU=“1”
GRAPHICS=[
LISTEN=“0.0.0.0”,
PORT=“5907”,
TYPE=“VNC” ]
MEMORY=“768”
OS=[
ARCH=“x86_64”,
BOOT="" ]
TEMPLATE_ID=“1”
VMID=“7”
[oneadmin@bravo02 ~]$

Can someone help me?

Thank you.

Ulisses

Frontend=CentOS 7 - KVM - VM=Debian 9


(Sergio) #2

Your issue is not related to the SSH keys contextualization. There is a networking issue, and according to the error you receive when attempting a SSH connection, you have no routes declared for 10.180.0.0/24 network. Besides that, you should also check that br0 bridge on the compute node has an active network link attached.


(Ulisses Castello) #3

Thank you, I’ll try to fix this.


(Ulisses Castello) #4

Hi Sergio,

Now I’ve changed the network to 10.180.0.0/24 and now I can
make a ping connection to the VM.

[oneadmin@bravo02 ~]$ ping 10.180.0.124
PING 10.180.0.124 (10.180.0.124) 56(84) bytes of data.
64 bytes from 10.180.0.124: icmp_seq=1 ttl=64 time=0.319 ms
64 bytes from 10.180.0.124: icmp_seq=2 ttl=64 time=0.320 ms
64 bytes from 10.180.0.124: icmp_seq=3 ttl=64 time=0.301 ms

But the ssh connection does not work.

[oneadmin@bravo02 ~]$ ssh root@10.180.0.124
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

I put the ssh context.

EDITOR = vi oneuser update oneadmin
SSH_PUBLICK_KEY=“ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcfD6PsAgtDZEhgjZbHWrW5pvPiT/qiDOkdy+xNtQtpWT29LIctwArKWatxkHBZ2jk9UylGZVVsInkt04AOiiSKtLPPoEN3iDoO69JMGi3vrhazhQMZmoPsDWasUX5GTskpnoy/hOLZA4CjeEowT0niG2ahUhnCTc+KBvczcq72lHtFNDJ75RooVUkeU5FISw1TDVijgsKPT7N1cPQVUzUorNIS8M9RhBAE5WKBwNVrhQXSe2r6KIR9ur+apWp/sOcjSZoJC6VvLNRj6AyrvCyr0PwI5I25Xvokx35BuUc0WokcchWdPyd+vCwCngc0dRzeOFlbMBv8sMITyfx5bi9 oneadmin@bravo02”
TOKEN_PASSWORD=“c3399b37b9b3d9f96ef6f1c3d34cc767138f0154”

I also instantiated a new VM.

What’s the problem now?

Thank you.
Ulisses