0

I am trying to SSH into my Raspberry Pi 4b with Ubuntu MATE installed as OS. This works perfectly fine when I first login on my raspberry pi (as this seems to enable some SSH client to start-up). To achieve this I have done the following;

  • Create a key on my laptop
  • Copy key to raspberry pi
  • etc. (standard steps)

I can SSH (using OpenSSH_7.6p1) without providing a password as expected. However, I need to login on Ubuntu MATE in order to be able to SSH into it from another system (my laptop). I obviously don't want to login on my Raspberry Pi every time I power it on (connect screen, connect keyboard etc.).

I SSH with; name@name2:~$ ssh ubuntu@^address and receive; ssh: connect to host ^address port 22: No route to host

^address being the placeholder for the ip. This command works perfectly when I have manually logged into my Raspberry Pi!

To solve the issue I believe I have tried everything answered on this site;

  • This which should enable SSH on boot
  • This (third answer) which alters the startup procedure for ssh socket and service
  • This (and many other duplicates) which changes the location of the authorized_keys from /home/name to /etc/ssh
  • Multiple different variations of sudo systemctl ... and sudo service ssh restart etc. etc.

Therefore, I am really at a loss on what to do. I feel like the third bullet point makes a lot of sense but still no luck.

All quite vague, so please ask me for any output of commands to help with your answer!

J.V.
  • 3
  • @user535733 I've edited the question. The problem is that I can SSH into the system only after I have logged in on the Pi (connect it to a screen, type in password, then SSH from laptop). The desired behavior is that I plug in the power supply to my Pi, wait a couple of seconds and then SSH into my Pi. Hope that clears it up. – J.V. Apr 28 '21 at 17:34
  • Are you saying the SSH port is closed until you log into MATE? – rtaft Apr 28 '21 at 17:45
  • @user535733 Updated my question. Thanks for the feedback. – J.V. Apr 28 '21 at 17:48
  • @rtaft I'm not an expert so not sure what is meant with 'closed' but yes, that does seem to be the case. Please see my updated question for what I get as an 'error' message after attempting to SSH – J.V. Apr 28 '21 at 17:49
  • 1
    Your edit answers the question, as @SEWTGIYWTKHNTDS said, the network is down, it's not an SSH problem. – rtaft Apr 28 '21 at 17:50
  • A TCP port can be 'open', 'closed', or unresponsive. In this case, it's saying it can't find the pi on the network so it can't tell you if the port is open/closed/unresponsive. – rtaft Apr 28 '21 at 17:52
  • I didn't even consider that. That does seem like an entirely different problem. Not sure to be happy or sad about that :) – J.V. Apr 28 '21 at 17:56
  • Is this Wifi we are talking about or ethernet? – rtaft Apr 28 '21 at 18:08
  • 1
    See https://raspberrypi.stackexchange.com/questions/100275/how-do-i-enable-wifi-before-login-on-ubuntu-mate-running-on-a-raspberry-pi – rtaft Apr 28 '21 at 18:10
  • @rtaft Wifi. Thank you very much for the suggestion, I'll check it out asap – J.V. Apr 28 '21 at 18:19
  • Works like a charm. Thank you so much both you and @SEWTGIYWTKHNTDS !! – J.V. Apr 28 '21 at 18:52

1 Answers1

1

Can you ping the Pi before you log into it locally? I wonder if the network isn't up until you log in. Maybe there are some power saving settings in Mate ? I don't have mate on a pi to check, but my pi is always available for ssh when running raspbian so it points to Mate.

SEWTGIYWTKHNTDS
  • 367
  • 1
  • 7
  • Do I ping with ping ^address? If so, then no packages are received either when I log in or when I am not logged in – J.V. Apr 28 '21 at 17:58
  • Indeed this was the problem. For the solution, refer to https://raspberrypi.stackexchange.com/questions/96056/how-can-i-ping-a-command-to-a-raspberry-pi-from-my-windows-machine everyone! – J.V. Apr 28 '21 at 18:52