Comments (13)
@aberbegall i'd try adding ssh.shell()
and then do ssh.forwardOut()
inside the shell callback and see if that works.
from tunnel-ssh.
@markelog I get the same issue with the same hosts if I use adit instead of tunnel-ssh.
from tunnel-ssh.
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.
Hi @mscdex, perhaps you could help me here, I can also file an issue in the ssh2 if you prefer it.
from tunnel-ssh.
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.
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.
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.
from tunnel-ssh.
@markelog No I've never tried, I only tried with putty and plink windows clients so far
from tunnel-ssh.
Is it possible to force an interactive session with ssh2 before the ForwardOut()?
I have never use the ssh2 module directly.
from tunnel-ssh.
@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.
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.
from tunnel-ssh.
Related Issues (20)
- migration from v4 to v5 HOT 5
- Server is not closed if client fails HOT 3
- There is no way to specify dynamic port HOT 2
- About using this module to test the connection process HOT 1
- Add typescript support / update @types/tunnel-ssh HOT 5
- Can not listen to events on the latest version HOT 1
- Time to update ssh2 to v1.12.0 HOT 1
- Connecting to MongoDB via tunnel-ssh HOT 2
- Multiple ports forwards HOT 3
- Logging verbose level
- Application crashing when `No Response from server` HOT 5
- About tunneling with Redis cluster (AWS Memory DB) HOT 1
- how to close the tunnel connection HOT 2
- Question : How to handle errors HOT 1
- (love) Just to tell you how great your software is HOT 1
- Supporting ed25519 ssh keys HOT 2
- Untie from ssh2 strict version HOT 4
- cpu-features causes build error on M1 macOS HOT 1
- not working with nodejs current version >14 HOT 2
- Unhandled Error during connection. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tunnel-ssh.