App Service SSH connection issue

Rajasekhar 21 Reputation points
2020-07-10T11:08:39.607+00:00

SSH CONNECTION CLOSE - Error: getaddrinfo ENOTFOUND Couldnt connect to main site container Couldnt connect to main site container:2222Error: getaddrinfo ENOTFOUND Couldnt connect to main site container Couldnt connect to main site container:22222Error: connect ECONNREFUSED 172.16.0.3:2222Error: connect ECONNREFUSED 172.16.0.3:2222Error: connect ECONNREFUSED 172.16.0.3:2222 CREDENTIALS

Getting the above error when i try to connect Azure APP--Service--> WEBServiceTesting --> SSH

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,051 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,421 questions
{count} votes

12 answers

Sort by: Most helpful
  1. Winston Fan 1 Reputation point
    2021-05-18T12:57:47.897+00:00

    Hi ,

    This is year 2021, same problem.....

    has anyone found a solution?

    0 comments No comments

  2. Amira SFARI 1 Reputation point
    2021-07-19T14:37:11.75+00:00

    july 2021 and always same problem

    0 comments No comments

  3. Ricardo Frazao 1 Reputation point
    2021-09-07T06:13:53.55+00:00

    Hi All, I have exactly the same problem.

    0 comments No comments

  4. Yardy, David 1 Reputation point
    2021-09-22T16:45:18.48+00:00

    Hi All, I have exactly the same problem as well.

    1. Using ubuntu base image
    2. Docker file contains

    https://learn.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux#enable-ssh

    https://dev.to/s1ntaxe770r/how-to-setup-ssh-within-a-docker-container-i5i

    RUN apt update && apt install openssh-server sudo -y RUN echo 'root:Docker!' | chpasswd RUN service ssh start

    Copy the sshd_config file to the /etc/ssh/ directory

    COPY sshd_config /etc/ssh/

    #sshd_config file looks like follows Port 2222 ListenAddress 0.0.0.0 LoginGraceTime 180 X11Forwarding yes Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr MACs hmac-sha1,hmac-sha1-96 StrictModes yes SyslogFacility DAEMON PasswordAuthentication yes PermitEmptyPasswords no PermitRootLogin yes Subsystem sftp internal-sftp

    #within bootstrap.sh, started ssh server with echo "start ssh server" /usr/sbin/sshd

    0 comments No comments

  5. Darius Scherle 1 Reputation point
    2021-10-01T12:09:03.727+00:00

    @Yardy, David I'm doing the same and have the same problems. When i execute the command "usr/sbin/sshd" by myself i get the following issue:
    Could not load host key: /etc/ssh/ssh_host_rsa_key
    Could not load host key: /etc/ssh/ssh_host_ecdsa_key
    Could not load host key: /etc/ssh/ssh_host_ed25519_key

    It seems we need privilege to do it (https://askubuntu.com/questions/639983/sshd-could-not-load-host-key)

    In the post of SnehaAgrawal-MSFT (https://learn.microsoft.com/en-us/answers/questions/220501/azure-web-app-with-linux-container-ssh-login-issue.html) he writes at is point 5 the statement - "RUN chmod 755 /opt/startup/init_container.sh". But for me this is not working. I get the error "chmod: cannot access '/opt/startup/init_ssh.sh': Not a directory"

    Perhaps anyone can work with this information for another hint to find a solution?