Giter Site home page Giter Site logo

Comments (13)

mscdex avatar mscdex commented on May 19, 2024 1

@aberbegall i'd try adding ssh.shell() and then do ssh.forwardOut() inside the shell callback and see if that works.

from tunnel-ssh.

aberbegall avatar aberbegall commented on May 19, 2024

@markelog I get the same issue with the same hosts if I use adit instead of tunnel-ssh.

from tunnel-ssh.

aberbegall avatar aberbegall commented on May 19, 2024

I keep investigating the issue, so far what I found this error in the target host log file

Nov  6 19:09:14 (none) sshd[2680]: error: connect_to 127.0.0.1 port 5900: failed.

so sshd complains that it cannot connect to 5900 port, and I verified that the x11vnc process was not running and therefore the port 5900 was not open. That's ok but:

In the /etc/password I have specified the following for 'myuser'

myuser::503:503:service:/var/home/myuser:/bin/start_x11vnc.sh

For each successful ssh session of 'myuser' the start_x11vnc.sh script should be executed, but it is not executed when doing port forward with this module.

For some reason when I do the same port forward with plink it does work fine, the start_x11vnc.sh gets executed, the port 5900 is listening and the client can connect to it through the tunnel.

My question now, is why it should be different with ssh2? Should I try first to establish a ssh connection and then execute ForwardOut separately, to ensure the user script gets executed just before?

Any help would be very appreciated.

from tunnel-ssh.

aberbegall avatar aberbegall commented on May 19, 2024

Hi @mscdex, perhaps you could help me here, I can also file an issue in the ssh2 if you prefer it.

from tunnel-ssh.

mscdex avatar mscdex commented on May 19, 2024

I'm afraid there's not much I can do if it's something server-side. Have you tried adding a statement at the top of your script that logs to a file when it's executed? That might help you narrow it down whether the script is not executing at all or just some line in the script is failing.

from tunnel-ssh.

aberbegall avatar aberbegall commented on May 19, 2024

Thanks, that's indeed what I tried in the script start_x11vnc.sh

#! /bin/sh
touch /tmp/executed

but I only get the file created when using plink port forward.
Any ideas other ideas?

from tunnel-ssh.

mscdex avatar mscdex commented on May 19, 2024

No idea, maybe plink is starting an interactive shell in the background, which might cause the shell in /etc/password to be executed? For ssh in general, you can forward ports separately from interactive sessions, command executions, etc. So tunnel-ssh is probably doing just that, since there is usually no use in spinning up an interactive shell session for port forwarding.

from tunnel-ssh.

markelog avatar markelog commented on May 19, 2024

from tunnel-ssh.

aberbegall avatar aberbegall commented on May 19, 2024

@markelog No I've never tried, I only tried with putty and plink windows clients so far

from tunnel-ssh.

aberbegall avatar aberbegall commented on May 19, 2024

Is it possible to force an interactive session with ssh2 before the ForwardOut()?
I have never use the ssh2 module directly.

from tunnel-ssh.

aberbegall avatar aberbegall commented on May 19, 2024

@mscdex @markelog thanks guys for the help, I will try that ssh.shell() and see if I manage to get the script executes and post some feedback here

from tunnel-ssh.

aberbegall avatar aberbegall commented on May 19, 2024

ssh.shell() did the trick 👍 executing the ssh.forwarOut() on its callback function ensures that the script execution is triggered just before.
Thank you again :)

from tunnel-ssh.

agebrock avatar agebrock commented on May 19, 2024

from tunnel-ssh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.