473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

webinterface to bash

Hi!

To relief the problems of accessing a unix machine from behind a
restrictive firewall or from an internet cafe I started to make a
PHP web interface to bash. I'd like to hear your opinions and
advice about my concept, especially regarding security.

There is already such a thing
(http://www.rohitab.com/cgiscripts/cgitelnet.html). However, it
lacks interactive input to programs. To fix this I'd use a frame
that displays the output of login, which turns into a shell that
will run our commands. The whole session output will be a single
http page. The input will be through a form in the small bottom
frame which will be forwarded by a PHP script through a unix
socket to the output PHP script. The output script uses
proc_open() to start login and forwards the data from the input
script through a pipe to login, bash and whatever command is
running. Data from the bash output pipe is sent to the web browser.

The input script will use stream_select() to wait for any data
from the IPC socket or the bash output pipe.

The script that defines the frames creates the socket in the file
system and pass its name to the input/output scripts via URL
parameter. It also generates a secret which the IO scripts use to
authenticate themselves in the unix socket IPC. I believe without
that any evil process could send commands to the output script.

Of course the session must be encrypted with SSL. If no SSL
certificate is bought from a certificate authority then IMO it
should be possible and secure to make a certificate and compare
its fingerprint with a copy on a small paper in a wallet.

What do you think?

Bernhard

--
Webspace; Low end Serverhousing ab 15 e, etc.: http://www.bksys.at
Linux Admin/Programmierer: http://bksys.at/bernhard/services.html

Jul 17 '05 #1
3 3470
On Wed, 17 Dec 2003 23:43:26 +0100, Bernhard Kuemel wrote:
Hi!

To relief the problems of accessing a unix machine from behind a
restrictive firewall or from an internet cafe I started to make a
PHP web interface to bash. I'd like to hear your opinions and
advice about my concept, especially regarding security.


Might I suggest MindTerm: http://www.mindbright.se/mindterm/, it's an ssh
client java applet.

Saves a lot of work on your part too. :)
Jul 17 '05 #2
Matt H <nn**@cox.net> writes:
On Wed, 17 Dec 2003 23:43:26 +0100, Bernhard Kuemel wrote:
Hi!

To relief the problems of accessing a unix machine from behind a
restrictive firewall or from an internet cafe I started to make a
PHP web interface to bash. I'd like to hear your opinions and
advice about my concept, especially regarding security.


Might I suggest MindTerm: http://www.mindbright.se/mindterm/, it's an ssh
client java applet.


PhpShell or MyShell aren't that bad either.

http://www.gimpster.com/wiki/PhpShell

Jochem

--
"A designer knows he has arrived at perfection not when there is no
longer anything to add, but when there is no longer anything to take
away." - Antoine de Saint-Exupery
Jul 17 '05 #3
Matt H <nn**@cox.net> writes:
On Wed, 17 Dec 2003 23:43:26 +0100, Bernhard Kuemel wrote:
Hi!

To relief the problems of accessing a unix machine from behind a
restrictive firewall or from an internet cafe I started to make a
PHP web interface to bash. I'd like to hear your opinions and
advice about my concept, especially regarding security.


Might I suggest MindTerm: http://www.mindbright.se/mindterm/, it's an ssh
client java applet.

Saves a lot of work on your part too. :)


The problem is if the client side is behind a firewall that doesn't
allow outgoing ssh connections. I've been in places where the only
contact with the outside was through an HTTP proxy. In such cases, it
might be possible to make the proxy believe you are connecting to an
https server and run ssh that way. I've never tried it though.

--
Måns Rullgård
mr*@kth.se
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Bowling | last post by:
I have a java (2.0) program with the following lines: String cmdArray1 = {"lp", "-d", "hp4m", "MyFile"}; System.out.println(Runtime.getRuntime().exec(cmdArray1)); It compliles properly, but...
2
by: Eric Woudenberg | last post by:
I just installed a Python 2.3.4 Windows binary on a friend's WinXP machine (because the latest Cygwin-provided Python 2.3 build leaves out the winsound module for some reason). When I try and...
4
by: Tom Purl | last post by:
I just wrote a Python script that is going to be called from bash script. If the Python script fails, I want the bash script to also stop running. Unfortunately, I can't seem to get that to work. ...
0
by: Allan Allan Ebdrup | last post by:
Hi I'm looking for the best webinterface for editing database data, for example publishing a table with foreign keys shown as a dropdown. I don't care what database the interface is for (MSSQL,...
11
by: Magnus Jonneryd | last post by:
Hi, I'm planning on writing a program that interactively is fed input via a shell (bash). I also want to be able to write a shell script that executes various commands related to my program. In...
16
by: John Salerno | last post by:
Hi all. I just installed Ubuntu and I'm learning how to use the bash shell. Aside from the normal commands you can use, I was wondering if it's possible to use Python from the terminal instead of...
6
by: Ishpeck | last post by:
I'm using Python to automate testing software for my company. I wanted the computers in my testing lab to automatically fetch the latest version of the python scripts from a CVS repository and...
4
by: melmack3 | last post by:
Hello My PHP script executes many bash/cmd commands. Functions like "exec()" or "system()" cause that new bash/cmd session is started, the command is executed and the session is closed....
6
by: Frantisek Malina | last post by:
What is the best way to do the regular bash commands in native python? - create directory - create file - make a symlink - copy a file to another directory - move a file - set permissions ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.