LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Apache to query tac_plus (https://www.linuxquestions.org/questions/programming-9/apache-to-query-tac_plus-4175419066/)

linux833 07-28-2012 07:41 AM

Apache to query tac_plus
 
Dear friends,

is it possible to quiery the tac_pwd from web page through apache to let user input his password then user could send it to me as encrypted by mail or what ever.

currently i should open the terminal and query tac_pwd manually in front of user.

apache already running on my server and configured to view log files.

my system is ubuntu 10.04.

thanks alot.


linux833

TB0ne 07-28-2012 02:56 PM

Quote:

Originally Posted by linux833 (Post 4739979)
Dear friends,
is it possible to quiery the tac_pwd from web page through apache to let user input his password then user could send it to me as encrypted by mail or what ever. currently i should open the terminal and query tac_pwd manually in front of user. apache already running on my server and configured to view log files.

my system is ubuntu 10.04.

Not sure what you're looking to do, since it's not very clear. How would you want the user to send it to you, via email? What are the "or whatever" options you have? The tac_pwd command, from what I can tell, is a command-line utility. You can easily write a web page using PHP to take input from a user, run any system utility, and output the results to the screen.

So, the answer to your question about whether it's possible to call tac_pwd from a webpage is "yes, it is possible". You would do it by writing a PHP page.

linux833 07-29-2012 02:35 AM

Hello TB0ne,
thanks alot for your reply, sorry if i was not clear. it's as simple you summarize, i need to execute an application from web so users could
open the page and get application executed then (Manually will send the password via email.


i'm new to programming language, could you please help me to write this script and lead me to where to place it.

i would appreciate any help.

linux883

TB0ne 07-29-2012 09:05 AM

Quote:

Originally Posted by linux833 (Post 4740419)
Hello TB0ne,
thanks alot for your reply, sorry if i was not clear. it's as simple you summarize, i need to execute an application from web so users could open the page and get application executed then (Manually will send the password via email.

i'm new to programming language, could you please help me to write this script and lead me to where to place it.

First start by looking up one of the many, easily-found PHP tutorials you can find on Google. This is from the PHP website, complete with an example:
http://php.net/manual/en/function.system.php

It performs the 'ls' command, and puts the results on the screen. Checking Google is always a good first step.

Where you put it, is up to you...and that will depend on how you set up your web server. You can place it in your webserver documentroot, but without knowing how you have it set up, we can't say.

linux833 07-30-2012 02:25 PM

Hello TB0ne,

thanks for your continues support,
actually the examples i found on the internet and share by my friends most about php script that will return output of
some commands, my case is different i need the php to to first read the execute the application internally within the server and output
the result.

it's like that
1-user will open the php link.
2-php will invoke the application on the server.
3-the application it self will generate read and required user input.
4-php will request read from user.
5-send read back to server application.
6-application will generate the output and php will echo it back to user.
----------------------------------------------------------------------
User:~$ telnet x.x.x.x
Trying x.x.x.x...
Connected to x.x.x.x.


AAA:~$ tac_pwd ---> user excute the application
Password to be encrypted: password -> application request input.
y/d6sWyZXc5NU -> application echo output.
AAA:~$


i know it's kind of hedeck and thanks for your help.

linux833

TB0ne 07-30-2012 02:43 PM

Quote:

Originally Posted by linux833 (Post 4741555)
Hello TB0ne,
thanks for your continues support,
actually the examples i found on the internet and share by my friends most about php script that will return output of
some commands, my case is different i need the php to to first read the execute the application internally within the server and output
the result.

No, it's NO different at all. Running one command and returning the values works the same for ANY command you run.
Quote:

it's like that
1-user will open the php link.
2-php will invoke the application on the server.
3-the application it self will generate read and required user input.
4-php will request read from user.
5-send read back to server application.
6-application will generate the output and php will echo it back to user.
----------------------------------------------------------------------
User:~$ telnet x.x.x.x
Trying x.x.x.x...
Connected to x.x.x.x.

AAA:~$ tac_pwd ---> user excute the application
Password to be encrypted: password -> application request input.
y/d6sWyZXc5NU -> application echo output.
AAA:~$
I would not use telnet for ANYTHING...you do realize that you'll be transmitting a user ID/password in clear text, not only over a web browser, but over the network too? Use SSH, and set that user up to do passwordless-logins, so you'll be able to run:
Code:

ssh user@server "tac_pwd"
on one line, without a password. But if you have the tac_pwd command on the server where your web page is, you don't even have to log in over the network...just run the command.

linux833 07-30-2012 02:52 PM

Hello TB0ne,

again sorry for unclear example, this telnet just to show exactly what i need to be done by php.
i'm not using telnet for management.

my case is that this application reside on the server, i need the php to act on the middle of the user and server tac_pwd application.

i need the php to excute the tac_pwd which will prompt user for password to be encrypted then it will pass the input request to user.
then php will send back the user input to tac_pwd to generate the needed output.


the problem when i use the php directly to excute the command it will work but will generate it's own password without user input.

could you please help on this please.


linux833.

TB0ne 07-30-2012 06:05 PM

Quote:

Originally Posted by linux833 (Post 4741577)
Hello TB0ne,
again sorry for unclear example, this telnet just to show exactly what i need to be done by php. i'm not using telnet for management.

my case is that this application reside on the server, i need the php to act on the middle of the user and server tac_pwd application. i need the php to excute the tac_pwd which will prompt user for password to be encrypted then it will pass the input request to user. then php will send back the user input to tac_pwd to generate the needed output.

the problem when i use the php directly to excute the command it will work but will generate it's own password without user input.

Again, I will suggest you start by looking up some VERY easily found PHP tutorials.
http://www.simplemachines.org/commun...p?topic=1285.0

Like I said in my first reply, write a web page to take input from the user, then pass that input to the command. Before we can help with anything, you will need to write some code for us to help you WITH.


All times are GMT -5. The time now is 03:56 AM.