473,396 Members | 1,725 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,396 software developers and data experts.

php exec problem

hi guys,

I need to create a page that execute a command on linux(ssh command)
and then display whatever it comes up on the webpage. I don't know how
to input the username after I execute the ssh command, can you help
pls?

Thanks in advance.

Jul 18 '05 #1
3 3067
On Sun, 17 Jul 2005 21:00:56 -0700, gl**@tollnz.co.nz wrote:
hi guys,

I need to create a page that execute a command on linux(ssh command) and
then display whatever it comes up on the webpage. I don't know how to
input the username after I execute the ssh command, can you help pls?

Thanks in advance.


... that's 'cos you can't... easily ( user is simple, password isn't ).
Programs like expect will allow you to set something up, but it may well
be better to set up a dedicated login to run the command ( add in the
command instead of the shell in /etc/passwd, and add to /etc/shells ), and
the use ssh-keygen et al to make for a passwordless ssh to
<newuser>@<remotehost>

$0.02,

Steve

Jul 18 '05 #2
Steve wrote:
On Sun, 17 Jul 2005 21:00:56 -0700, gl**@tollnz.co.nz wrote:
hi guys,

I need to create a page that execute a command on linux(ssh command) and
then display whatever it comes up on the webpage. I don't know how to
input the username after I execute the ssh command, can you help pls?

Thanks in advance.


.. that's 'cos you can't... easily ( user is simple, password isn't ).


Never tried, but isn't it possible with proc_open() ?

C.
Jul 18 '05 #3
Thanks guys,

expect is an option, however I might get the rsa key setup.

Colin McKinnon wrote:
Steve wrote:
On Sun, 17 Jul 2005 21:00:56 -0700, gl**@tollnz.co.nz wrote:
hi guys,

I need to create a page that execute a command on linux(ssh command) and
then display whatever it comes up on the webpage. I don't know how to
input the username after I execute the ssh command, can you help pls?

Thanks in advance.


.. that's 'cos you can't... easily ( user is simple, password isn't ).


Never tried, but isn't it possible with proc_open() ?

C.


Jul 21 '05 #4

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

Similar topics

6
by: Hal Vaughan | last post by:
I have a script used to find and run Java on a Windows system.  It worked fine on original tests (on a Windows XP system).  It's now running on a Windows 2000 (sp3) system, and it won't work -- the...
0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
5
by: TPJ | last post by:
I have the following code: ----------------------------------- def f(): def g(): a = 'a' # marked line 1 exec 'a = "b"' in globals(), locals() print "g: a =", a
4
by: Michael | last post by:
Hi, I'm having difficulty finding any previous discussion on this -- I keep finding people either having problems calling os.exec(lepev), or with using python's exec statement. Neither of...
21
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
2
by: Uldis Bojars | last post by:
Hi All, I have encountered problems with JS RegExp.exec() and can't find what is the problem. Could you help me? formRequest is a function that extracts some information from XMLHTTPRequest...
26
by: warth33 | last post by:
Hello I have a php site. Some page needs to call an external program. The programs are home made c# applications. It uses to work without problem. For a while. Maybe it work for some hour....
23
by: Maarten | last post by:
Howdy, Recently I switched from a Windows PC to Mac OS-X 10.5 (php v5.2.6) and I have a little problem with one function within my cd-management script. For extracting a bit of info from my...
7
by: gregory.lielens | last post by:
Hi, I am using a small python file as an input file (defining constants, parameters, input data, ...) for a python application. The input file is simply read by an exec statement in a specific...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
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...
0
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,...

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.