none
SSH is failing while creating Web apps container using custom docker image through Azure docker registry RRS feed

  • Question

  • SSH is failing while creating Web apps container using custom docker image through Azure docker registry . Getting connection refused or Host unknown while trying to ssh . While the image is successfully running in my local .

    Can some help me on this 

    FYI ..

    I have already exposed the port 2222 and starting the ssh service through Dockerfile entry point .I ma using  base oel  6 os image (From oraclelinux:6)

    SSH CONNECTION CLOSE - Error : Connect ECONNREFUSED  XXXXXXXXXXXXX:2222 CREDENTIALS

    Monday, April 9, 2018 12:09 PM

All replies

  • Were you able to follow the steps in the below document, which setup the SSH server?

    Thursday, April 19, 2018 7:17 PM
    Moderator
  • I have the same issue. My container accepts SSH connection when run locally, but not when run on Azure. I folllowed the tutorial, but unfortunately our container does not have systemd. Therefore, it cannot run any services, so service ssh-server start is not an option. Instead, I have to call /usr/sbin/sshd -D in the init script. When run locally, this allows me to login as root with the Docker! password, but not on Azure.

    [Edit]I think a portmapping is missing in the run command that is used in Azure. If I repeat the run command locally, I have to add the port mapping -p 2222:2222. Without it, exactly the same error message that I am getting on Azure. Wonder why the EXPOSE 2222 directive has no effect.

    [Edit]I just proved that the EXPOSE directive just works. If I run the container with -P (to publish exposed ports to the host), it gets randomly mapped to a port, at which I can connect with SSH as expected. 

    The run command on Azure is simple missing -p 2222:2222. I cannot find where I can add parameters to the command nor do I know which setting would cause the command to change in this way, if it cannot be changed directly.

    • Edited by bartmcleod Tuesday, September 4, 2018 1:53 PM
    Tuesday, September 4, 2018 11:44 AM
  • I am having exactly the same issue as @bartmcleod.

    I have built various docker images, based on ubuntu as described in the documentation, and others that use  a standalone alpine container that calls src/sbin/sshd -D.

    For each I have tested that I can reach them locally with the following:

    # Publish exposed 2222 port
    > docker run -it --rm -p 9999:2222 --name sshd <container name>

    Then connecting to it with:

    > ssh root@127.0.0.1 -p 9999
    Unable to negotiate with 127.0.0.1 port 9999: no matching cipher found. Their offer: aes128-cbc,3des-cbc,aes256-cbc

    This indicates that everything is working as expected. However I am still greeted with Error: connect ECONNREFUSED 172.19.0.3:2222 on the Web SSH console.

    I am deploying a multi-container application using docker-compose. Could this be why I am not able to connect via SSH?


    Monday, October 1, 2018 1:55 PM
  • Any updates? Same issue
    Thursday, December 27, 2018 12:39 AM
  • I am having exactly the same issue as @bartmcleod.

    I have built various docker images, based on ubuntu as described in the documentation, and others that use  a standalone alpine container that calls src/sbin/sshd -D.

    For each I have tested that I can reach them locally with the following:

    # Publish exposed 2222 port
    > docker run -it --rm -p 9999:2222 --name sshd <container name>

    Then connecting to it with:

    > ssh root@127.0.0.1 -p 9999
    Unable to negotiate with 127.0.0.1 port 9999: no matching cipher found. Their offer: aes128-cbc,3des-cbc,aes256-cbc

    This indicates that everything is working as expected. However I am still greeted with Error: connect ECONNREFUSED 172.19.0.3:2222 on the Web SSH console.

    I am deploying a multi-container application using docker-compose. Could this be why I am not able to connect via SSH?


    I have the exact same issue with a Web App for Containers on Linux. My image works fine locally, and I'm able to SSH into it using port 2222, but when I run it on Azure nothing works. 

    Attempting to create a tunnel using "az webapp create-remote-connection [...]" ends up with "Timeout Error, Unable to establish a connection" with the warning (by using --verbose) "Status response message: FAILURE:2222:Unable to connect to WebApp WARNING - Remote debugging may not be setup properly. Reponse content: FAILURE:2222:Unable to connect to WebApp"

    Web SSH on Kudu gives me "connect ECONNREFUSED xxx.xxx.xxx.xxx:2222"

    Did any of you ever reach a solution to the issue?


    Thursday, August 8, 2019 4:26 PM