|
Doing remote computing by issuing commands through electronic mail |
|
By Ray Swartz Alberto Ferrari is looking for a way to run commands on a system that he can't log into. What's more, he needs to do it from different systems. The solution involves a mail filter shell script and a C program to add security. The Script Is in the MailQuestion: Because I sometimes travel to places with e-mail but no online connections to the Internet, I'd like to have a way to remotely execute a script on my office system. My idea is to send the script as an e-mail message and get the results back in another e-mail message. I know this feature would introduce security problems into the system, but I could send some form of identification along with the script. Any ideas? Alberto Ferrari / Florianopolis, BrazilAnswer: In essence, you want to filter your mail and, if the message contains commands to execute, have the filter run the commands for you. As you mention, you need a way to stop unauthorized people from executing commands on your system. Using passwords is dangerous because they must travel in plain text across the network; a better idea is to encrypt the mail containing the commands to run. While always using the same key for encrypting your command messages will work, I decided to add more security by using a onetime key system; that is, a series of random numbers known to both the sender and the receiver but no one else. The random-number generator I selected was certified as good by Donald Knuth's seminal work, The Art of Computer Programming, Volume 2. Every time you use one of these numbers, you mark it off your list. Your system will be doing the same thing. The information required is (1) a way to announce that a message contains commands to run, (2) the e-mail address that is to receive the commands' output, and (3) authorization. To identify that a message contains commands, put the words ``Script to run'' in the subject line. The message body must identify the return address with the line ``Return address:'' followed by the e-mail address that is to get the output of the enclosed commands. Authorization is granted if the message contains a Return address line after decrypting. The rest of the message contains the commands you want to run. Because the encrypted message may contain non-ASCII
characters, it must be run through uuencode
before you can e-mail it. The The Some setup is required for these programs. First, in
You must also set up a .forward
file in the home directory of the account that will receive the
execution messages. The The Part D shows the steps required to prepare a command file for insertion into an e-mail message. One important point about preparing your mail message. When a
file is encoded with |
Print This Page Send as e-mail |












