Execution problem unix commands in Perl CGI


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execution problem unix commands in Perl CGI
# 8  
Old 01-06-2012
Quote:
Originally Posted by Navrattan Bansa
No I am not forgetting ssh there i am creating directory in local Unix machine.
But what is the username@host at the beginning for? That command won't work.

Code:
$ username@machine_name 'ls dirname'
bash: username@machine_name: command not found
$


Quote:
I didn't get exactly your answer.
# chown :apache /dirname ## i didn't gat apache here what does it means here.
apache is the file group. apache needs write permissions to the folder to mkdir inside it. so you change the group to apache, and give apache write-access.


Quote:
where i have to do these actions :
On terminal or in the .cgi script ?
In terminal. You only need to do it once.
Quote:
what is the alternative for SSH.
You don't need an alternative to ssh. You need to give ssh the things it needs to work without a password. It'd also help to run ssh in the first place.

You did get ssh working without a password, yes? If not, you're going to have to do so, because there's no way for a user to interactively type in a password over CGI.
# 9  
Old 01-06-2012
i want to do it via webpage . Is your script would be able to call via .html file ?

---------- Post updated at 12:08 AM ---------- Previous update was at 12:04 AM ----------

one thing i want to ask more. that for SSH . what to do with id_rsa files and how. actually i dont know about this thing.
and where to place and what to place so that apache can read???
Can you give me an example.???
# 10  
Old 01-06-2012
I know you want to do it via webpage. That's why you have to worry about all these permissions -- the script is being run by the webserver, not by you. It can only access things belonging to the apache group or the apache user. It it doesn't have access to your files, folders, or keys. If you make them belong to apache, or create copies belonging to apache, it can access those.

Please answer my questions so I can help you.
# 11  
Old 01-06-2012
Please can you illustrate rsa_id concept so that i can understand what to do????
# 12  
Old 01-06-2012
That depends on what you've done already. Did you set up passwordless SSH for your user, or not?

what is the username@host at the beginning for? That command won't work.

And all the other questions I asked and received no answer for.

I'm not asking questions to piss you off, I'm asking questions because I need the answer to help you. Please answer my questions so I can help you.
# 13  
Old 01-06-2012
Yes yes SSH i forgot....
The exact command is:
@array = `ssh username@machine_name 'ls dirname'`; # It is no tgiving list of files available on this directory
sorry i misunderstood you ques.
# 14  
Old 01-06-2012
Thank you. Now answer my other questions too.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl execution commands

I don't know to debug the program todaylive.pl program. plz someone let me know what are the commands I need to know to debug the perl programs to find out the error on it. (3 Replies)
Discussion started by: ramkumar15
3 Replies

2. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

Hi All, I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet. I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet. print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies

3. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

Hi team, I have a typical problem with cgi pages in apache webserver in WINDOWS I am able to execute(display) the pages that are saved in cgi-bin folder. But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder. Could anyone please let me know how... (1 Reply)
Discussion started by: scriptscript
1 Replies

4. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

5. Web Development

cgi script and external UNIX commands (like swadm)

Hi, I am trying to implement a server monitoring dashboard using cgi scripting. I am planning to run the necessary unix scripts from the web page using cgi. This method works fine for standard unix commands but I am unable to run some external unix commands (like swadm show_processes, swadm... (9 Replies)
Discussion started by: jofinjoseph
9 Replies

6. Shell Programming and Scripting

Execution problem with perl

I got the below error when using the below code...it seem that perl interpret the "'" in the middle and therefore the pipe is not finished. perl -wle ' @a=`who| perl -wlane 'print \$F;' | sort -u` ; chomp @a ; print @a; ' the error message in cygwin is:- perl: No match. | sort... (12 Replies)
Discussion started by: ahmad.diab
12 Replies

7. UNIX Desktop Questions & Answers

CGI execution problem on Unix

Hello everyone, I have developed a cgi application on windows. i have created a folder in webapps of tomcat, within that a WEB-INF folder and in that cgi folder. This cgi folder contains one executable. The web.xml is as follows: <servlet> <servlet-name>cgi</servlet-name> ... (2 Replies)
Discussion started by: Preeti_t
2 Replies

8. Solaris

Solaris 10.5 perl and cron job execution problem

Hi, I want to run a crontab job on solaris 10.5. I have configured the crontab accordingly 10 * * * * /scripts/dbalter.pl >> /scripts/cronout.txt However this does not work .Then I go to /var/mail/root and find an error in the output: From root@myserver Wed Feb 4 17:02:00 2009... (1 Reply)
Discussion started by: sonu2die4
1 Replies

9. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (6 Replies)
Discussion started by: ran16
6 Replies

10. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (0 Replies)
Discussion started by: ran16
0 Replies
Login or Register to Ask a Question