docker-ssh
docker-ssh copied to clipboard
closed by remote host
docker run -d -p 2222:22
-v /var/run/docker.sock:/var/run/docker.sock
-e FILTERS={"name":["^/ufoym/deepo:all-py36-jupyter$"]}
-e AUTH_MECHANISM=simpleAuth
-e AUTH_USER=gumush -e AUTH_PASSWORD=1234
jeroenpeeters/docker-ssh
i've got this messages in no auth and simple auth with user mode too.
Connection to localhost closed by remote host. Connection to localhost closed.
Take a look into "docker logs [container name]" You can also bring some debug output on (server.coffee):
options = privateKey: fs.readFileSync keypath debug: (str) -> log.info 'ssh2Debug:', str
Got very similar error the logs are:
> [email protected] start /usr/src/app
> ./node_modules/forever/bin/forever -c ./node_modules/coffee-script/bin/coffee server.coffee | ./node_modules/bunyan/bin/bunyan
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
[2018-12-21T08:45:28.114Z] INFO: sshServer/33 on dc38db9760ba: Docker filter
filter: {
"name": [
"^/444c3b6a64a6$"
]
}
[2018-12-21T08:45:28.155Z] INFO: webserver/33 on dc38db9760ba: Listening (host=::, port=8022)
[2018-12-21T08:45:28.156Z] INFO: sshServer/33 on dc38db9760ba: Docker-SSH ~ Because every container should be accessible
[2018-12-21T08:45:28.156Z] INFO: sshServer/33 on dc38db9760ba: Listening (host=0.0.0.0, port=22)
[2018-12-21T08:45:40.611Z] INFO: sshServer/33 on dc38db9760ba: Client connected (clientIp=172.17.0.1)
[2018-12-21T08:45:40.690Z] ERROR: noAuthHandler/33 on dc38db9760ba: NoAuthentication handler is handling the authentication! This is INSECURE!
[2018-12-21T08:45:40.776Z] INFO: sessionHandler/33 on dc38db9760ba: Opening shell
/usr/src/app/src/session-handler-factory.coffee:21
for (i = j = 0, ref = length - text.length; 0 <= ref ? j <= ref : j >= ref; i = 0 <= ref ? ++j : --j) {
^
TypeError: Cannot read property 'length' of undefined
at /usr/src/app/src/session-handler-factory.coffee:7:41
at spaces (/usr/src/app/src/session-handler-factory.coffee:25:7)
at header (/usr/src/app/src/session-handler-factory.coffee:13:34)
at Session.<anonymous> (/usr/src/app/src/session-handler-factory.coffee:81:28)
at emitTwo (events.js:106:13)
at Session.emit (events.js:191:7)
at SSH2Stream.onREQUEST (/usr/src/app/node_modules/ssh2/lib/server.js:653:16)
at emitOne (events.js:96:13)
at SSH2Stream.emit (events.js:188:7)
at parse_CHANNEL_REQUEST (/usr/src/app/node_modules/ssh2-streams/lib/ssh.js:4356:8)
at parsePacket (/usr/src/app/node_modules/ssh2-streams/lib/ssh.js:3727:12)
at SSH2Stream._transform (/usr/src/app/node_modules/ssh2-streams/lib/ssh.js:551:13)
at SSH2Stream.Transform._read (_stream_transform.js:167:10)
at SSH2Stream._read (/usr/src/app/node_modules/ssh2-streams/lib/ssh.js:212:15)
at SSH2Stream.Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:331:12)
at writeOrBuffer (_stream_writable.js:317:5)
at SSH2Stream.Writable.write (_stream_writable.js:243:11)
at Socket.ondata (_stream_readable.js:555:20)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:547:20)
error: Forever detected script exited with code: 1
Used the container ID instead of the container name.
is there any update of this?
Apparently, this error occurs when the container binding is not working. Try using container id instead of the container name as mentioned above and it should not happen.
hi all, i got this kind of error too. It is the error connecting containers between this ssh and objective container.
Finally, i change this container name syntax and works now ==> -e FILTERS={"name":["^/orig_container_name$"]} It is my fault in syntax as all " instead.
Just sharing and reminder to new comer.
hi all,
I've had same issue and got it to work with this regex: FILTERS={\"name\":[\"^container-name\"]}
Someone may find it helpful.