Por meio da LAN, posso fazer ssh do meu laptop para o meu RPi sem problemas usando minha chave pública.
A saída de depuração do ssh no caso de sucesso:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: moritz@my_hostname
debug1: Server accepts key: pkalg ssh-rsa blen 279
Se eu tentar usar o ngrok na WAN, recebo a seguinte saída:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: moritz@my_hostname
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/moritz/.ssh/id_rsa
debug1: Trying private key: /home/moritz/.ssh/id_dsa
debug1: Trying private key: /home/moritz/.ssh/id_ecdsa
debug1: Trying private key: /home/moritz/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
Em ambos os casos eu faço ssh pi-user@ip-adress e o arquivo /home/pi-user/.ssh/authorized_keys é fornecido na forma correta dentro do arquivo /etc/ssh/sshd_config
No servidor, eu uso a versão ngrok / ARM e iniciei com ngrok 22
Eu conectei o serviço ssh e https na configuração do meu roteador com o Raspberry.
Alguma idéia por quê?
Nesse meio tempo, encontrei esta resposta:
sudo chmod -c g-w /home/lorddaedrafixed my problem. So need change 775 to 755 on user home directory. If > anyone know reason why 775 is bad please comment..I do not have enough reputation to comment, so this goes in a separate answer. The reason that you had to change the permissions to 755 is that you have StrictMode set to yes, which means: StrictModes yes The option StrictModes specifies whether ssh should check user's permissions in their home directory and rhosts files before accepting login.
desta postagem link to servefault_SO
Eu não estou em casa, mas vou tentar na próxima semana.