r/linuxfromscratch • u/ojodesombra • Mar 10 '25
SSH in VirtualBox
I have the LFS set up in a VM. Now i need to keep using it for some school assignments and i want to set up SSH so its easier to work with it. I followed all the steps in this link
I can access ssh from the machine itself but when trying from the host i cant reach it. I have the network adapter set to NAT and i have forwarded the correct ports. When i try to access via SSH it hangs for a bit and then throws this message:
$ ssh root@127.0.0.1 -p 3434
kex_exchange_identification: read: Connection reset by peer
Connection reset by 127.0.0.1 port 3434
I also tried setting up an http server with python to check if it has something to do with the ssh config but i also get an error:
$ curl -v 127.0.0.1:8080
* Trying 127.0.0.1:8080...
...
* Request completely sent off
* Recv failure: Connection reset by peer
* closing connection #0
curl: (56) Recv failure: Connection reset by peer
If anyone knows what config could i be missing or any guides/resources i could look at that would be great. I don't really know much about how to configure networking on linux so i may be missing something really obvious.

View all comments
Show parent comment
1
u/ojodesombra Mar 11 '25
OK this worked but in a weird way. in the screenshot i have 2 adapters configured.
What i did is i removed the second one and tried with one bridge adapter. It only allowed me to give it the name enp0s8 so i did that. I got the same error but when connecting with the ip of the enp0s3 it just worked
I guess the enp0s3 is created by Vbox by default ?? Anyway doing:
just worked so thank you <3