Score:1

SSH showing no Output

sz flag

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
ar flag
Please [edit your question](https://askubuntu.com/posts/1470887/edit) and indicate if your "other machine" is another virtual machine, or a real (bare metal) machine. It is possible that the two machine's are in different subnets. What is the ip address of the "other machine"? Is it `10.0.2.XX`? What do you get if you `ping -c4 10.0.2.15` from the "other machine"? Add all these to your question.
Massimo Di Saggio avatar
sg flag
To me it seems that port 22 on your target machine is not exposed. You could try to set an explicit timeout interval with the -o ConnectTimeout=10 option and see if you get such an error message after 10 seconds.
ar flag
Try `ssh -vvvv 10.0.2.15` for a more verbose output. See [this answer](https://askubuntu.com/questions/1107987/connect-two-computers-with-ssh-in-a-home-lan/1108044#1108044) for a tutorial on setting up `ssh`.
ar flag
Add more information about your virtual machine's host, and your "other machine" you are sshing from. Are they the same? What are their LAN IP addresses? Do you have any firewalls running on the virtual machine?
petep avatar
in flag
try using "bridged adapter" in vm settings
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.