Using procmail to remote-control your comp
December 11, 2007
My computer at IITM is jailed onto the local network due to NAT, Proxy server etc.
Thus, my computer back there has access to internet, but the internet doesn’t have access to it. So, how do I run commands on it remotely? Here’s a simplified crappy version that works to do this.
My system is on almost all the time and connected to the IITM intranet. It keeps downloading my mail from a mail server (that is accessible both from the intranet and the internet) using a cronjob running getmail and passes all received mail to procmail. If your setup uses procmail to filter mail and it is invoked through a cronjob (or by a daemon or something), you could get procmail to execute command lists from your e-mail. In .procmailrc, you’d add something like this:
# —– STARTS HERE —–
:0 fbHB
^<some test cases to identify if the email is a command list>
| bash # I do something better than this, but the code is dirty.Will post after improvisation.
/dev/null
# —– ENDS HERE —–
Of course, there’s a lot more scope for improvisation, like verifying PGP signature to ensure that the message is really from somebody who’s authorized to control the computer.
Entry Filed under: GNU/Linux/FOSS. Tags: grunt, Linux, procmail.
1 Comment Add your own
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed
1.
akarshsimha | December 18, 2007 at 4:57 pm
Interestingly, somebody has done this better already, and there’s even a Debian package!
sudo apt-get install grunt
* PGP Support
* Uses Procmail