I have not used SSH before so I'm probably doing something wrong. I am trying to connect to a VM via SSH. On the VM I ran ip a | grep inet
which provided this output:
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp1s0
inet6 fec0::71ba:9fda:943b:113a/64 scope site dynamic noprefixroute
inet6 fe80::afca:876f:1e52:40fb/64 scope link noprefixroute
On the other machine I run ssh -v 10.0.2.15
and it gives this output:
OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 10.0.2.15 [10.0.2.15] port 22.
That's all it does. If I run ssh without the verbose flag it prints nothing. The terminal is locked up and I have to kill the process with ctrl+c. What am I doing wrong and how can I connect to this virtual machine with ssh?
Running the command ping -c4 10.0.2.15 gives this output:
PING 10.0.2.15 (10.0.2.15) 56(84) bytes of data.
^C
--- 10.0.2.15 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3076ms
The command ssh -vvvv 10.0.2.15
gives this output:
OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname 10.0.2.15 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '$HOME/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '$HOME/.ssh/known_hosts2'
debug3: ssh_connect_direct: entering
debug1: Connecting to 10.0.2.15 [10.0.2.15] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10