1

I made a multipass server with ssh and it says it timed out. I'm using the ipv4 they supplied me, and openssh is already installed

enter image description here

roan
  • 21
  • 1
  • 3

3 Answers3

0

There is a helpful guide on setting up SFTP access on an Ubuntu 18.04 server by Digital Ocean here: https://www.digitalocean.com/community/tutorials/how-to-enable-sftp-without-shell-access-on-ubuntu-18-04.

I would double check the following:

  1. Verify the username and password works. Multipass comes with the ubuntu user, if you added a new user it would be best to verify connectivity
  2. Ensure the instance has started (e.g. multipass list)
  3. Verify openssh is running on the instance

Hopefully this helps get you up and running, if you just need access to the instance (without copying files) you can run multipass exec machine and you will be dropped into a shell inside the instance.

Jason M.
  • 563
  • 1
  • 5
  • 10
0

It was may caused by the change of IPv4 address. If you run the multipass list command, you may find something similar with the following output.

PS C:\Users\Slhmy> multipass list
Name                    State             IPv4             Image
dev                     Running           172.28.88.123    Ubuntu 20.04 LTS
                                          172.28.95.47

Running ssh root@172.28.88.123 will meet timeout problem, but ssh root@172.28.95.47 will not.

The I run multipass shell dev and check image's network...

root@dev:/etc/network/if-up.d# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.28.95.47  netmask 255.255.240.0  broadcast 172.28.95.255
        inet6 fe80::5054:ff:fe4c:d87e  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:4c:d8:7e  txqueuelen 1000  (Ethernet)
        RX packets 670  bytes 199807 (199.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 461  bytes 64486 (64.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        ...

The address of eth0 changed. You can get the ssh connection by the new IPv4 but I think it's not a good try because it seems that every time I restart my dev system the address changed.

So the right solution should be setting a static IPv4 address or something... But I don't know how to realize it. If somebody know the solution, please tell me.

Thanks a lot.

--------------------------------------------------------New Findings--------------------------------------------------------

According to Add integration with SSH #1957 in multipass's repository it is possible to connect to the instance by <instance-name>.mshome.net if using hyper-v.

I have tried this solution and works for me.

PS. Before I start the ssh service, I changed some of the configurations and make it works for me. But I think this may not relate with this problem, because if configuration haven't get gone, ssh should denied the connect.

slhmy
  • 11
  • 4
0

Have you tried to create a local user and set PasswordAuthentication yes on /etc/ssh/sshd_config?

If you have changed, you must need to restart the SSH service by sudo systemctl restart sshd or service sshd restart