igor47 / pitunnel

reliable reverse-ssh tunnel for raspberry pi
MIT License
36 stars 6 forks source link

sshd: no hostkeys available on remote #2

Open thomarse-ef opened 2 months ago

thomarse-ef commented 2 months ago

Hey. I'm getting an error when setting up remote. The command to test sshd setup produces an error:

pi@raspberrypi:~ $ sshd -t && echo 'looks good' || echo 'sshd config is invalid'
sshd: no hostkeys available -- exiting.
sshd config is invalid

I have added the ssh key to /home/pitunnel/.ssh/authorized_keys and have modified the permissions per the instructions. Is there anything else I need to so? /home/pitunnel/.ssh/authorized_keys looks like this:

ssh-ed25519 <long_string_of_characters_and_numbers> pi@raspberrypi

Is this correct?

igor47 commented 2 months ago

where did you get that command to "test sshd" ? i think you want to just test "ssh" -- the client, not the daemon.

thomarse-ef commented 2 months ago

I meant this line from the readme sshd -t && echo 'looks good' || echo 'sshd config is invalid'

igor47 commented 2 months ago

ah i see the confusion. this is meant to be run on the remote machine. that's the machine you're keeping the persistent tunnel to. seems like you're running the command on the pi itself. moreover, you're invoking that command as a regular user, which means you don't have access to the machine's host keys (those are root-readable only).