question

AnselmCoogan-2758 avatar image
0 Votes"
AnselmCoogan-2758 asked ·

SSH'ing into multi-container app

Hi,
I have a multi-container app running as an app service; however, I'm having trouble ssh'ing into it.

In the dockerfile of my webapp I'm exposing ports 8000 and 2222.

Request to port 80 are reverse-proxied via nginx and if appropriate forwarded to my app running on port 8000.
That all works fine.

However, I can't connect via remote ssh although I'm running sshd via supervisord (`/usr/sbin/sshd -D -f /etc/ssh/sshd_config`) on port 2222 of my application.
Also setting the password for root to "Docker!" in my docker build as per the documentation.
No idea what's going wrong.

When I look at the logs at LogFiles/webssh/pm2.err I am however seeing this:

 /opt/nodejs/9.4.0/lib/node_modules/pm2/lib/ProcessContainerFork.js:30
     import(url.pathToFileURL(process.env.pm_exec_path));
     ^^^^^^
    
 SyntaxError: Unexpected token import
     at new Script (vm.js:51:7)
     at createScript (vm.js:138:10)
     at Object.runInThisContext (vm.js:199:10)
     at Module._compile (module.js:624:28)
     at Object.Module._extensions..js (module.js:671:10)
     at Module.load (module.js:573:32)
     at tryModuleLoad (module.js:513:12)
     at Function.Module._load (module.js:505:3)
     at Function.Module.runMain (module.js:701:10)
     at startup (bootstrap_node.js:193:16)
 (node:259) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
 (Use `node --trace-deprecation ...` to show where the warning was created)
 Error: Invalid username
     at Client.connect (/opt/webssh/node_modules/ssh2/lib/client.js:209:11)
     at Namespace.<anonymous> (/opt/webssh/index.js:143:8)
     at Namespace.emit (events.js:165:20)
     at Namespace.emit (/opt/webssh/node_modules/socket.io/lib/namespace.js:209:10)
     at /opt/webssh/node_modules/socket.io/lib/namespace.js:177:14
     at process._tickCallback (internal/process/next_tick.js:150:11)

But maybe this is just a result from failing to connect...

Any tips appreciated!
Thanks

azure-webappsazure-webapps-ssh
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered ·

@AnselmCoogan-2758, are you accessing SSH through SCM? Per stated in https://docs.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux#enable-ssh, external connections aren't allowed through openssh. The same section also has a link to NodeJS 10.14 repo as an example of how it's enabled. You can compare commands with what's in the repo for any differences. If you're still having issues, can you post your dockerfile and docker compose down below?

Regards,
Ryan


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.