butlerx / wetty

Terminal in browser over http/https. (Ajaxterm/Anyterm alternative, but much better)
https://butlerx.github.io/wetty
MIT License
4.26k stars 670 forks source link

--sshhost and --sshport options do not work #8

Closed omniproc closed 10 years ago

omniproc commented 10 years ago

I'm trying to run wetty on hostA using

node app.js --sshhost hostB --sshport 22 -p 3000

From the Readme and the cmd options I was thinking this would allow me to open http://hostA:3000 and open a ssh settion to hostB. However, this seems not to work. The ssh connection that opens always points to hostA.

Is this a issue or just undocumented?

krishnasrinivas commented 10 years ago

I am unable to reproduce this issue. It is working as expected. Can you do console.log(sshhost) before this line in app.js: term = pty.spawn('ssh', [sshuser + sshhost, '-p', sshport, '-o', 'PreferredAuthentications=' + sshauth], {

See if it points to HostA or HostB, you could put console.log()s at appropriate places to see whats happening. Let me know if you think there is a bug.

omniproc commented 10 years ago

Looking at the code, I saw the line: if (process.getuid() == 0) {....

and realized that when running as root, it will ALWAYS run /bin/bash - no matter what parameters are passed. Knowing this, the documentation reads compleatly different ^^ I think it would be good to state this fact even more clear :-)

So, consider this as a "documentation improvement suggestion" - and keep up the great work :+1: