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

minor suggestions for improvement #2

Closed terryschen closed 10 years ago

terryschen commented 10 years ago

Hi,

I got this working for my personal server. It is pretty darn useful. Kudos for putting this project together and making it open source.

The only minor hiccup was that I use a non-standard SSH port and I want to let the user choose the username (the script as-is forces the user to be the same user that started the node server).

So, I put together a simple perl script (sshuser.pl) that is called by app.js that looks like this:

#!/usr/bin/perl

my $addr = $ARGV[0];

print "Enter your username: ";
my $username = <STDIN>;
chomp ( $username );
exec ("/usr/bin/ssh -p <non standard ssh port here> $username\@$addr");

Maybe you or other user may find it useful.

Terry

krishnasrinivas commented 10 years ago

Added options --sshuser and --sshport in the latest commit. Can you check if it works fine for you?

terryschen commented 10 years ago

Wow, fast response.

Hi, the sshport works. But the sshuser is not quite what I wanted. With the way the code works, I believe it is still hardcoded at startup. I would like to support different users after the server have started.

But thanks for the sshport commit!

Terry

krishnasrinivas commented 10 years ago

You don't want to run it as root? If you run app.js as root it will spawn /bin/login and it will let you choose username.

terryschen commented 10 years ago

I don't normally like to run webapps as root. Granted, this may just be paranoia on my part. Also, I may not always have root access. As an example, I am running this on a dev box and the administrator has only granted me the ability to run wetty via nginx port forwarding.

Anyway, running as root and using /bin/login does work...So, if this is too much trouble, please close the bug and I can continue to use the perl script I have pasted in earlier.

Thanks! Terry

krishnasrinivas commented 10 years ago

latest commit has the option to specify the username. I have updated the README can you check if it is clear? let me know if it works for you.