Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Web-Based SSH on your own web-server...
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Web-Based SSH on your own web-server...

eastoncheastonch Member
edited March 2013 in General

Hi,

I've got a quick query, I'm always at college or work when something major happens on one of my personal nodes or even on the SwiftVM nodes, (albeit, it's a rare occurance) and my phone has no signal, machines are locked down, and there's no feasible way to get into a SSH prompt without some dodgy HTTP bullshit.

I'm wondering if anybody is aware of any 'scripts' I can place on a private web server and be able to use it to give me a SSH prompt, with usage of Private Keys, whatnot, I can't see it being impossible, since there's the PHP Exec(); command, however, I'd like it to have feedback to myself so I can see everything that's output remotely.

Suggestions are helpful :)

-Chris

«1

Comments

  • The answer is liftoff software's Gate One.

    You can find out more here, http://liftoff.github.com/GateOne/About/index.html

    And no, this isn't PHP, it's Python.

  • EvixoEvixo Member

    @eastonch said: and there's no feasible way to get into a SSH prompt without some dodgy HTTP bullshit.

    Is it because port 22 is blocked? If yes, then I'd use a VPN instead.

  • rskrsk Member, Patron Provider

    @Evixo said: Is it because port 22 is blocked? If yes, then I'd use a VPN instead.

    Some places block everything except http and https.

    You can run an SSH Tunnel using https port :) @eastonch

  • @Evixo I assume that using a :80 webserver on a VPS, then using that as the gateway to a SSH prompt would not be blocked, assuming that I'm not directly connecting to a prompt, according to my 'college' policy the use of unauthorized programs will result in negative fun ^^. -- So I'm reluctant to use the Putty executable judging by previous experience of dismissal of students because the IT department is scared of Linux.

  • @rsk give me an example please :) this would be something fun to setup.

  • rskrsk Member, Patron Provider

    @eastonch - Actually, if you just want to SSH.

    -create a vps and change its ssh port to 443 (https is not blocked anywhere really)
    -login normally to your VPS with your new port.
    -from your vps just issue "ssh root@yourothernodeIP" and it will take you to your other node.
    -once done just "exit"

    The cheap and reliable way :)

  • rskrsk Member, Patron Provider

    @eastonch said: So I'm reluctant to use the Putty executable judging by previous experience of dismissal of students because the IT department is scared of Linux.

    They will not dismiss you, it is their fault for not "securing" their network down to the ground haha

  • @rsk said: The cheap and reliable way :)

    Is what I did at one stage, but have to say this:

    @Wintereise said: The answer is liftoff software's Gate One.

    Is better.

  • @RSK I guess that's fine, I was going to start carrying my PPK around with me, but then realised the security risk that it imposes (minimal, since half of my surroundings dont' understand the term SSH and i scared the head techie here by talking about OpenVZ virtualisation. (We're still using 03' Server)).

    I got puTTY working on a non-standard port that's different from 443, 80, 25 whatnot. :P

    Still would like to setup a online gateway though.

  • Use "Command Shell" within Webmin

  • @Noerman never used Webmin before, I assume the command line is like a full SSH prompt?

  • @eastonch said: So I'm reluctant to use the Putty executable judging by previous experience of dismissal of students because the IT department is scared of Linux.

    haha, you call that an "IT department"?

  • WintereiseWintereise Member
    edited March 2013

    ...I guess he didn't read. Gateone was more or less created for this specific problem - accessing shell apps via HTTP.

    SSH is just one implementation of it, feel free to write your own if you know Python and Js.

    Oh well.

  • @eastonch said: never used Webmin before, I assume the command line is like a full SSH prompt?

    Preview Webmin -> Others -> Command Shell
    Hopefully fits your need. But it accessed using http, SSH prompt without usage of Private Keys

    image

  • Thanks, had a go, looks good. Sort of want a HTTP tunnel that encrypts data so I can access Twitter etc. :/ need to dedicate a little more to utilize all these servers I have.

  • EvixoEvixo Member

    @eastonch said: Thanks, had a go, looks good. Sort of want a HTTP tunnel that encrypts data so I can access Twitter etc.

    We offer VPN services (https://pingbuster.net) which is used kind for this stuff.

    If you don't like to use any third-party, you can easily setup your own (Open)VPN server.

  • webmin adress is like htps://ipadres:10000
    if ports blocked, he cant access
    i installed squid on port 80, it was easy and working fine
    but school firewall sometimes blocking the ads when i use my proxy... its not that secure i think...

  • Am I the only one where school doesn't give a F about what I'm looking at? It isn't the first time there is porn on a pc.

  • You can use anyterm for web based ssh on your own server.

  • joepie91joepie91 Member, Patron Provider

    @Evixo said: We offer VPN services (https://pingbuster.net) which is used kind for this stuff.

    You 'lower the ping'...? How does that work?

  • JanevskiJanevski Member
    edited March 2013

    @eastonch If You have decided to use Webmin then You could set it to listen or port 443 instead of 10000 under Webmin>Webmin Configuration>Ports and Addresses.
    image
    And then use Others>Command Shell as a web shell. Make sure You insert all the needed input data, arguments and switches within one line.
    Another way is to change SSHD listening port from 22 to 443, and then connect to it.
    image
    Another way is to set up SSTP VPN listening on port 443. You could do it by for example OpenVPN or SSHD.
    Yet another way would be using DNS tunneling but that's a little bit extreme.

  • perennateperennate Member, Host Rep
    edited March 2013

    @eastonch said: I can't see it being impossible, since there's the PHP Exec(); command, however, I'd like it to have feedback to myself so I can see everything that's output remotely.

    It is possible to create something in PHP that also gives the output. Here's an example that let's you connect via something like telnet client and send commands:

    <?php set_time_limit(0); $sock = socket_create(AF_INET, SOCK_STREAM, 0); socket_bind($sock, "0.0.0.0", 1234) or die("fail bind"); socket_listen($sock); $client = socket_accept($sock); $addr = ""; socket_getpeername($client, $addr); $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("pipe", "w") // stderr is a file to write to ); $res = proc_open("bash", $descriptorspec, $pipes); stream_set_blocking($pipes[1], 0); stream_set_blocking($pipes[2], 0); while(true) { $str = socket_read($client, 4096, PHP_NORMAL_READ); if($str === false) { break; } fwrite($pipes[0], trim($str) . "\n"); for($i = 0; $i < 50; $i++) { socket_write($client, fgets($pipes[1])); socket_write($client, fgets($pipes[2])); } } proc_close($res); socket_close($client); socket_close($sock); ?>

    There was something I found to actually open a bash terminal, not sure where it is. Either way, this would need to be changed to have authentication and web interface and such. Definitely not the best solution :)

    But it is useful if you accidentally stop SSH or something, lose shell access, but still can use webserver.

    Edit: bash terminal instructions: rooftopsolutions.nl/blog/189

  • Interesting thread. Here is another one than seems lighter:
    http://code.google.com/p/shellinabox/
    And this one that doesn't require any installation:
    https://codeanywhere.net/web-based-ssh-terminal-client

  • @hostingwizard_net you're a saviour :)

  • raindog308raindog308 Administrator, Veteran

    I'd just like to add that running sshd on 443 and going through the proxy that way doesn't work on all proxies. For example, Microsoft-based proxies (NTLM) defeat this.

    AjaxTerm is another way to have a self-hosted, purely web-based SSH session.

    There's also sslh, which I haven't personally tried:

    http://www.rutschle.net/tech/sslh.shtml

  • ghostghost Member
    edited December 2013

    anyterm based on C++ and support Linux/*BSD
    since others were python or js based.
    antterm, stuanel and virtualhost maybe a solution. I don't sure...

    commando.io is a on-line service maybe fit to use.

  • I'm not sure I've ever heard of one, but PHP can use sockets natively (right?) so I'd imagine a quick google search would produce some results

    One Google search later...

    Found this terminal emulator in java script, that should be similar to what you are looking for. Enjoy! https://code.google.com/p/shellinabox/source/browse/demo/vt100.js

  • petrispetris Member
    edited December 2013

    Ok, first, wow @ghost, you dug this post up from the depths of LET.

    Second, I would say that if all the OP is looking for is web-based SSH then @Wintereise's suggestion of GateOne is an excellent choice and works well.

  • Hey guys. Founder of https://commando.io here. Let me know if you have any questions or feedback. Always willing to help out LowEndTalk users.

    @ghost said:
    anyterm based on C++ and support Linux/*BSD
    since others were python or js based.
    antterm, stuanel and virtualhost maybe a solution. I don't sure...

    commando.io is a on-line service maybe fit to use.

  • wcypierrewcypierre Member
    edited December 2013

    @Commando said:
    Hey guys. Founder of https://commando.io here. Let me know if you have any questions or feedback. Always willing to help out LowEndTalk users.

    any chances of trying the beta? I can't seem to find the registration page

    update: found it.

Sign In or Register to comment.