CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Executing scripts on a server.

 



satipandu
Deleted

Mar 9, 2000, 10:38 PM

Post #1 of 4 (639 views)
Executing scripts on a server. Can't Post

Hi !!!

I had a pretty complicated question -probably having an easy answer. But, anyway, here is the question.

Application requested:
A CGI program that inputs a server name, user name, password and command from a html file and executes the required command on the server after authenticating the user name with the password.
Problems i ran into:
When a user comes to a web page, he is "nobody". He can telnet only to the server hosting the web page whereas the command the user wishes to execute may not reside on the host. Tried to do a second telnet from the first. Cant get the second telnet to read the user name and password.
Workaround:
I made the first cgi program write a file that stores the user name and password with the server name and the command. The cgi file transfers control to the second perl program which makes use of this written file. Had problems 'cos i was not able to debug the second prog using the first. And, this is not a good solution.
I look forward to hearing from you.

Thanks a lot for the help Smile

Cheerio Smile
Satish


Jasmine
Administrator

Mar 22, 2000, 4:21 AM

Post #2 of 4 (639 views)
Re: Executing scripts on a server. [In reply to] Can't Post

The answer is Net::Telnet.

By using Net::Telnet in your program, you can connect to any server (that allows telnet connections) and execute commands. You can get the server name, login and password from cgi input, if you wish.

Net::Telnet's documentation is at http://theoryx5.uwinnipeg.ca/CPAN/data/Net-Telnet/Net/Telnet.html. The link to download the module is at the top of the page.

Good luck!

[This message has been edited by Jasmine (edited 03-22-2000).]


satipandu
Deleted

Apr 4, 2000, 5:00 PM

Post #3 of 4 (639 views)
Re: Executing scripts on a server. [In reply to] Can't Post

Thanks a lot Jasmine.
The thing is I get to to work for myself but we start getting into trouble while using someone else's login.

I've nailed down my problem to the .cshrc file. When others use my .cshrc file, they are able to do the telnet. They cant do that using their own .cshrc file. Also, I'm not able to telnet when I use someone else's .cshrc file but works fine with me. Any reasons that you may think of ?

Thanks a lot again Jasmine Smile
Enjoy !


Jasmine
Administrator

Apr 4, 2000, 5:17 PM

Post #4 of 4 (639 views)
Re: Executing scripts on a server. [In reply to] Can't Post

I'm not certain what you mean that the cshrc file is causing problems, and that it's okay when you're using one and not the other. I (and many others) have successfully used the module one numerous servers without fail.

Could you please post your code? Perhaps there's a different problem at hand.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives