Hey, love the project and mostly working well! I have got the server up and running (currently on an AWS EC2 instance). I can connect to it from all of the following with a standard ssh -oStrictHostKeyChecking=no -p 2222 -R ben:80:localhost:80 sish-host.com
But the second I run this within a container (docker run or compose), it just fails. I've tried just about everything I could think of, but can't work it out. This is the ssh -v
output
debug1: Reading configuration data /etc/ssh/ssh_config
Pseudo-terminal will not be allocated because stdin is not a terminal.
debug1: Connecting to sish-host.com [99.99.99.99] port 2222.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version Go
debug1: no match: Go
debug1: Authenticating to sish-host.com:2222 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
debug1: checking without port identifier
Warning: Permanently added '[sish-host.com]:2222,[99.99.99.99]:2222' (RSA) to the list of known hosts.
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /root/.ssh/id_rsa
debug1: Will attempt key: /root/.ssh/id_dsa
debug1: Will attempt key: /root/.ssh/id_ecdsa
debug1: Will attempt key: /root/.ssh/id_ed25519
debug1: Will attempt key: /root/.ssh/id_xmss
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentication succeeded (none).
Authenticated to sish-host.com ([99.99.99.99]:2222).
debug1: Remote connections from ben:80 forwarded to local address localhost:80
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
Press Ctrl-C to close the session.
Starting SSH Fowarding service for http:80. Forwarded connections can be accessed via the
following methods:
HTTP: http://ben.sish-host.com:80
HTTPS: https://ben.sish-host.com:443
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 2 clearing O_NONBLOCK
Connection to sish-host.com closed by remote host.
Transferred: sent 1700, received 1512 bytes, in 0.0 seconds
Bytes per second: sent 42334.2, received 37652.5
debug1: Exit status -1
sish_1 exited with code 255
This is the server-side
15:44:05 Accepted SSH connection for: 44.44.44.44:58208
15:44:05 Main Channel Info session
15:44:05 Handling session for connection: &{session [] 0 0 32768 32768 0xc000162a10 true 0 0xc000205740 {0 0} 0xc0002056e0 false {0xc00014be40 2097152 0 false} 0xc000208f00 0xc000208f40 {0 0} 2097152 {0 0} false map[]}
15:44:05 Main Request Info tcpip-forward true benP
15:44:05 Error trying to write message to socket: read tcp 10.0.2.4:2222->44.44.44.44:58208: use of closed network connection
15:44:05 Closed SSH connection for: 44.44.44.44:58208 user: root
15:44:13 =======Start=========
15:44:13 ===Goroutines=====
15:44:13 10
15:44:13 ===Listeners======
15:44:13 [::]:2222 &{0xc0000cf500 {<nil> 0}}
15:44:13 ===Clients========
15:44:13 ===HTTP Clients===
15:44:13 ========End==========
Where 99.99.99.99 is sish on the EC2 server and 44.44.44.44 is my local IP.
I have been using this as a basis https://github.com/jacobtomlinson/docker-serveo. It works fine with my serveo instance on the same 99.99.99.99 server. For the purposes of testing, I created a minimal Dockerfile, which is confirmed and working with Serveo, but not with sish.
FROM alpine:3
RUN apk --no-cache add openssh
ENTRYPOINT ["ssh", "-v", "-oStrictHostKeyChecking=no", "-p", "2222", "-R", "ben:80:localhost:80", "sish-host.com"]
Here are my sish params
-sish.addr=:2222
-sish.auth=false
-sish.https=:443
-sish.http=:80
-sish.httpsenabled=true
-sish.httpspems=/etc/letsencrypt/live/sish-host.com
-sish.keysdir=/pubkeys
-sish.password=""
-sish.pkloc=/keys/ssh_key
-sish.bindrandom=false
-sish.domain=sish-host.com
-sish.forcerandomsubdomain=false
-sish.debug=true
If I can do anything to support, please let me know. Thanks again!