views:

245

answers:

2

Is there a tool that will allow me to issue commands over the network without SSH?

For example, I'd like to create a new linux box armed with DVD burners and send this command over the network "growisofs -dvd-compat -Z /dev/dvd -dvd-video dvd" with arguments and send the file to burn. The system would be automated so I need something that can do this easily and efficiently.

A: 

You could use netcat with a shell bind. This is, of course, quite dangerous if the network is publicly exposed.

Google search

Rushyo
Yea i think this is more into what I was looking for. Thanks.
Chris
+1  A: 

Here's my comment in elaborated answer form.

On the local host, run ssh-keygen, most likely saving the key in the default location and not using a passphrase. Next, use ssh copy-id <user@host> to copy the public key to the remote host.

For your script, do something like:

scp "$FILE_TO_BURN" $REMOTE_USER@$REMOTE_HOST:"$BURN_DROP_DIR"
ssh $REMOTE_USER@$REMOTE_HOST $BURN_COMMAND
ssh $REMOTE_USER@$REMOTE_HOST rm "$BURN_DROP_DIR/$(basename $FILE_TO_BURN)"

Feel free to flesh it out with error detection by capturing the exit status/output of the ssh commands. You might also want to look into doing this without copying the whole file first using something like sshfs (packaged by most distros) to mount the directory containing the file to burn over the network.

Jefromi
Actually I should state my question is how to make a program network accessible. I want people to be able to execute my PHP script and have my PHP script dynamically execute the burning program. So is having PHP executing "scp "$FILE_TO_BURN" $REMOTE_USER@$REMOTE_HOST:"$BURN_DROP_DIR"ssh $REMOTE_USER@$REMOTE_HOST $BURN_COMMANDssh $REMOTE_USER@$REMOTE_HOST rm "$BURN_DROP_DIR/$(basename $FILE_TO_BURN)" really the best way to do this?
Chris