App service SSH problem - sshd: no hostkeys available -- exiting.

Tony 6 Reputation points Microsoft Vendor
2022-11-30T11:28:33.177+00:00

Posting on behalf of a customer who keeps experiencing errors when trying to post.*

I have issues getting SSH to work in my App-service.

I've followed this tutorial:
https://learn.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux#enable-ssh

Unable to post details of the docker file and ssh config as I keep getting an error. Full details can be found here though:

https://gist.github.com/allinws/2a0f9eb5bcba8fe877a09441197a613a

resulting logstream
2022-11-29T14:09:53.619211457Z Starting ssh
2022-11-29T14:09:53.629362955Z Started ssh
2022-11-29T14:09:53.629389255Z Starting gunicorn
2022-11-29T14:09:53.629412756Z sshd: no hostkeys available -- exiting.
2022-11-29T14:09:53.901363055Z [2022-11-29 14:09:53 +0000] [7] [INFO] Starting gunicorn 20.1.0
2022-11-29T14:09:53.901392755Z [2022-11-29 14:09:53 +0000] [7] [INFO] Listening at: http://0.0.0.0:8000 (7)
2022-11-29T14:09:53.905616438Z [2022-11-29 14:09:53 +0000] [7] [INFO] Using worker: sync
2022-11-29T14:09:53.913574393Z [2022-11-29 14:09:53 +0000] [9] [INFO] Booting worker with pid: 9

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,326 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Ryan Hill 26,946 Reputation points Microsoft Employee
    2022-11-30T22:02:40.473+00:00

    @Tony ,

    In your dockerfile, I don't see where you copied your ssh_setup.sh script file. You're copying the existing (base image) file to /tmp. You create this file and copy it during docker build.

    1 person found this answer helpful.
    0 comments No comments