473,770 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3493
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
8258
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 does not print the file to the printer. It displays the following as the return from Runtime...: java.lang.UNIXProcess@1034bb5
2
2984
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 run this newly installed Python from bash it just hangs (no version message, no prompt, CPU is idle). When I run it from IDLE, or the DOS CMD prompt, it runs fine. Also, Python scripts using the new version run fine, even invoked on the bash command...
4
3275
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. Here's the script so far: # custom python script /usr/bin/python /home/username/Dev/Python/packZODB.py \ -s"gsgmc.sigma.zettai.net" -b 7 # next program
0
1406
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, MySQL, Oracle, MySQL, Access, Filemaker, PostgreSQL, ...), and the price of the software is also "irrelevant", I just want the best piece of software. Any help would be greatly appreciated. What do you use? Note: Follow-Up is set to the...
11
2996
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 short i want to provide input to a program using some (or all) of the functionality found in bash. It's mainly the format of the file I'm having trouble with. I wanted to be able to write something like this: #!/bin/bash for x in xs
16
3947
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 the normal bash commands (e.g. print instead of echo). My main reason for asking is that I like using Python for everything, and if I don't need to learn the bash 'language', then I won't just yet. Thanks.
6
3946
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 then ask a local database server which of the scripts to run. I built the following: #!/bin/bash # Batcher will run the specified scripts.
4
3580
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. Unfortunately it is very slow process so I would like to increase performance and open one bash/cmd session on the begin of my script and execute the commands such as in normal system opened bash/cmd window and close it
6
1870
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 I need to write a program that creates real application/FTP accounts
0
10102
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.