webssh2 | Web SSH Client using ssh2 socket.io xterm.js | Websocket library
kandi X-RAY | webssh2 Summary
kandi X-RAY | webssh2 Summary
Web SSH Client using ssh2, socket.io, xterm.js, and express. A bare bones example of an HTML5 web-based terminal emulator and SSH client. We use SSH2 as a client on a host to proxy a Websocket / Socket.io connection to a SSH2 server.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Setup the websocket connection .
- BasicAuthAuth handler
- Sets default credentials
- Parses true boolean
- return rrout handler
- This function is used to introspect
- this is an internal function
webssh2 Key Features
webssh2 Examples and Code Snippets
Community Discussions
Trending Discussions on webssh2
QUESTION
I'm trying to create a web page where the user can authenticate to a remote server via ssh with username/password, and then interact with the remote server.
I'm not looking to create a full interactive terminal: the app server will execute a limited set of commands based on user input and then pass the responses back to the browser.
Different users should interact with different ssh sessions.
My app is built in Meteor 1.8.1, so the back end runs under Node JS, version 9.16.0. It's deployed to Ubuntu using Phusion Passenger.
I have looked at several packages that can create an interactive ssh session but I am missing something basic about how to use them.
For example https://github.com/mscdex/ssh2#start-an-interactive-shell-session
The example shows this code:
...ANSWER
Answered 2020-May-06 at 09:46I got this working by following these instructions for creating an interactive terminal in the browser and these instructions for using socket.io with Meteor.
Both sets of instructions needed some updating due to changes in packages:
meteor-node-stubs now uses stream-http instead of http-browserify https://github.com/meteor/node-stubs/issues/14 so don't use the hack for socket
xterm addons (fit) are now separate packages
- xterm API has changed, use term.onData(...) instead of term.on('data'...)
I used these packages:
ssh2
xterm
xterm-addon-fit
socket.io
socket.io-client
and also had to uninstall meteor-mode-stubs and reinstall it to get a recent version that doesn't rely on the Buffer polyfill.
Here's my code.
Front end:
myterminal.html
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install webssh2
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page