LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   running commands automatically via SSH (https://www.linuxquestions.org/questions/linux-general-1/running-commands-automatically-via-ssh-145555/)

tpfraz 02-13-2004 01:14 AM

running commands automatically via SSH
 
Hello.
I'm trying to figure how to do something that I think is possible.
I have many users on a server that I would like to give access to one
particular script. However most of them don't know how to use SSH or Linux and I would rather not have to teach them all.
So, what I want to do is setup some kind of SSH client for them that they can simply run. But instead of logging into the Linux box and giving them a command prompt, it just logs in, runs the command, and exits. All while being fairly transparent to the user. Of course the user would at some point have to enter a username and password.
Also, if possible, it would be nice to be able to integrate this into a web page. I was looking at MindTerm for that, the Java applet.

Does anyone know of any way to do this? Or of any SSH clients (preferably free) that have these kind of configuration options?

Also, I don't have access to these users individual machines. So it would be best to have something that I could configure and then hand over to them. Which is another reason a web based client would be nice.

Any help is very much appreciated.

Thanks,
Travis

Rounan 02-13-2004 09:12 AM

I don't know anything about it, but I know that PHP is capable of this. Probably java too, or python, or any number of others.

It sounds like the best thing to do is set up a web page that the users can access, with some basic fields: user, password, and a "run my script" button. With this input, a web-based script like PHP can run the command as the user directly on the server, without the need fo a SSH connection or the like.
I used a program called Music Player Daemon (MPD) on an old box with apache, and I was able to control the daemon's playlist, volume, song controls, etc via a PHP-scripted web interface. That was pretty complicated - you can try examining that source if you like, but it's probably far more than you need.
Unfortunately, I don't know anything about PHP or any other web-based language, so I can tell you it can be done, but not how to do it!
I'm sure there have to be tutorials/articles in the Programming forum, or on our good friend Google.

Cheers,
--Rounan


All times are GMT -5. The time now is 03:21 PM.