huashengdun / webssh

:seedling: Web based ssh client
https://webssh.huashengdun.org/
MIT License
4.48k stars 1.26k forks source link

Closing worker with reason: worker recycled #367

Open jasthema opened 10 months ago

jasthema commented 10 months ago

hi there

I have compose the webssh for docker with command docker-compose up. All works if in my laptop browser I connect directly to the host where docker runs. (https://myapp.com)

now I connect to a server to authenticate user (https://myauthserver.com) vs the LDAP, and if user is allowed it redirect to FQDN of my docker (https://myapp.com). but once I try to trigger the ssh connectivity, I got an error, session is closed with Closing worker with reason: worker recycled.

in some blog I found to add the --origin parameter, putting "*" or the DNS name, or to increase the delay. but nothing.

here my last version of Docker file:

FROM python:3.9 EXPOSE 8888 RUN pip install webssh CMD wssh --ssladdress='0.0.0.0' --sslport=443 --certfile='/PATHTOCERT/certificate.crt' --keyfile=''/PATHTOCERT/certificate.key' --origin='https://myauthserver.com' --delay=6 --redirect=true

I put the certificate on /PATHTOCERT/

then I started the docker as below: docker run --name webssh-test -d -v /PATHTOCERT/:/PATHTOCERT/ -p443:443 webssh-master-web

so if I run browser to go directly to the host where docker run, all works: here the log [I 231103 15:21:20 web:2344] 200 GET / (MYIP) 1.02ms [I 231103 15:21:25 handler:452] Connecting to XXXXXXXXXX:22 [I 231103 15:21:25 transport:1893] Connected (version 2.0, client OpenSSH_8.0) [I 231103 15:21:25 handler:86] Trying password authentication [I 231103 15:21:26 transport:1893] Auth banner: b'Authorized uses only. All activity may be monitored and reported.\n' [I 231103 15:21:26 transport:1893] Authentication (password) successful! [W 231103 15:21:28 handler:446] Could not detect the default encoding. [I 231103 15:21:28 web:2344] 200 POST / (MYIP) 2879.68ms [I 231103 15:21:28 web:2344] 101 GET /ws?id=YYYYYYYYYYYYYYYYYYYYYYYYYY (MYIP) 0.80ms [I 231103 15:21:28 handler:537] Connected from XXXXXXXXXX:54996

but If use an intermediate server to authenticate user versus LDAP, then it redirect to docker web: [I 231103 15:22:29 web:2344] 200 GET / (AuthenticationServerIP) 1.01ms [I 231103 15:22:37 handler:452] Connecting to XXXXXXXXXX:22 [I 231103 15:22:37 transport:1893] Connected (version 2.0, client OpenSSH_8.0) [I 231103 15:22:37 handler:86] Trying password authentication [I 231103 15:22:37 transport:1893] Auth banner: b'Authorized uses only. All activity may be monitored and reported.\n' [I 231103 15:22:37 transport:1893] Authentication (password) successful! [I 231103 15:22:37 web:2344] 200 POST / (AuthenticationServerIP) 755.35ms [W 231103 15:22:41 web:2344] 400 GET /ws?id=YYYYYYYYYYYYYYYYYYYYYYYYYY (AuthenticationServerIP) 0.72ms [W 231103 15:22:43 worker:33] Recycling worker YYYYYYYYYYYYYYYYYYYYYYYYYY
[I 231103 15:22:43 worker:123] Closing worker YYYYYYYYYYYYYYYYYYYYYYYYYY with reason: worker recycled [I 231103 15:22:43 worker:131] Connection to XXXXXXXXXX:22 lost

what I am missing? which parameter shall I add to wssh ?

Disk-MTH commented 8 months ago

Hello, @jasthema, I have the same problem, have you fix it ?

jasthema commented 8 months ago

@Disk-MTH , not solved yet :-(

Chenhu-source commented 4 months ago

I met as well

futurecad commented 2 weeks ago

Have you solved this problem?

jasthema commented 2 weeks ago

Not solved, I discontinued the project. It seems a problem of proxy redirect and I guess the docker image is not compatible with it. I had similar problem with other containers behind proxy redirect authentication. I had to create a firewall rule to limit access.

futurecad commented 1 week ago

Not solved, I discontinued the project. It seems a problem of proxy redirect and I guess the docker image is not compatible with it. I had similar problem with other containers behind proxy redirect authentication. I had to create a firewall rule to limit access.

What other projects have you changed to subsequently?