SSH CONNECTION CLOSE - Error: Timed out while waiting for handshake while connecting to

asked 2021-11-15T01:36:05.293+00:00
Dylan Porter 1 Reputation point

I went to connect to on one of my web apps to day and was getting an SSH CONNECTION CLOSE - Error: Timed out while waiting for handshake and this also happens in two other web apps that I'm running, but not in one with identical configuration that I spun up to test

they were working last week when I went on and since then I haven't made any code or configuration changes

Azure Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,305 questions
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2021-11-17T08:53:49.807+00:00
    SnehaAgrawal-MSFT 11,096 Reputation points Microsoft Employee

    Thanks for reply! To elaborate on this, there may be multiple reasons for unable to use the SSH feature in Kudu.

    The most common cause of an inability to SSH into a container is either the Web App isn't running or the Kudu container isn't running. Therefore, if you are unable to SSH into your app container, you should do the following two things first.

    1. Ensure that the Web App is currently running.
    2. Ensure that the Kudu site is currently running.

    If your Web App is not running and won't start then check the docker log, this is helpful in troubleshooting your site when it doesn't start or if it's restarting. Different ways to access Docker logs is below:

    1. Docker logs appear on the Container Settings page in the portal.
    2. You can find the Docker log in the /LogFiles directory. You can access this via the Kudu (Advanced Tools) Bash console or by using
      an FTP client to access it.
    3. You can use our API to download the current logs.

    You may refer to the blog Things You Should Know: Web Apps and Linux for more details on this.

    If the Kudu site isn't running, please let me know.

    Note: Whether you're using SSH via a web browser or using the TCP tunnel method, SSH connections are always hitting an endpoint in the Kudu container. If the Kudu container isn't running, you won't be able to SSH into the app's container.

    Also, it could a browser related issue or a backend issue. Starting a SSH session in a different browser might helps, try starting a SSH session by running

    az webapp ssh -n MyUniqueAppName -g MyResourceGroup in the Azure CLI

    If case you are using a docker-compose file with multiple containers for your App, keep in mind that Azure will always connect to the frontend container even if other containers have port 2222 exposed.

    Check this discussion here.

    Check this blog: Things You Should Know: Web Apps and SSH

    Hope this helps.

    No comments