Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I execute a process on a remote machine running Linux without SSH. Since the machine is scheduled to PXE-boot periodically, the SSH key will be changed and executing a process through a script using SSH is ruled out. Any idea on how it can be done?

share|improve this question

5 Answers 5

Regular re-installing via pxe does not preclude the use of ssh.

I don't know what distro you're using but it could be trivial to have the pxe install add public halves of ssh keys to the system's authorized_keys file. (I'm most familiar with Red Hat / Fedora and I always do this with my pxe setups.)

share|improve this answer

ssh would be safest with keys in place; but you can setup a webserver on remote box and execute commands by sending them to some php or cgi script that will then run command for you. why is ssh a problem? What kind of command are you running?

share|improve this answer

Crontab will help you. Add your script in crontab that will automatically run your script.

share|improve this answer
    
If the process must be execute every time the machine starts, the solution suggests by Sandeep is perfect. –  lg. Feb 27 '12 at 9:26

If your SSH problem related to SSH keys known_hosts file, you can disable host key verification. Have a look at this post. However, you need to be sure that you are safe from MITM attack.

A web interface can be created to execute the command, but you need to grant the web server process user the enough permissions to execute the needed commands (possibly using sudoers).

share|improve this answer

What about using /etc/rc.d/rc.local file? This is executed at boot time.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.