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!

11
  • @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, 2021 at 17:34
  • Are you saying the SSH port is closed until you log into MATE?
    – rtaft
    Apr 28, 2021 at 17:45
  • @user535733 Updated my question. Thanks for the feedback.
    – J.V.
    Apr 28, 2021 at 17:48
  • 1
    Your edit answers the question, as @SEWTGIYWTKHNTDS said, the network is down, it's not an SSH problem.
    – rtaft
    Apr 28, 2021 at 17:50
  • 1

1 Answer 1

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.

2
  • 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, 2021 at 17:58
  • Indeed this was the problem. For the solution, refer to raspberrypi.stackexchange.com/questions/96056/… everyone!
    – J.V.
    Apr 28, 2021 at 18:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .