Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I administer a home server, and sometimes when I'm out I need to execute some simple commands on the server. 3G + SSH is not an option because it's too expensive from my phone (here in Argentina). It is easier to send an SMS to my mail account. **

I want to fetch the mails I send to my server, and process the text surrounded by ** as bash commands.

What approach would you recommend?

share|improve this question
This is opening a huge security hole. You should only process messages properly signed with a GPG key or otherwise encrypted by you. – Caleb Jun 9 '11 at 8:20
It's necessary, but not enough, to sign the mails. You also need to protect against replay attacks. This looks nontrivial if you can't have any back-and-forth. – Gilles Jun 9 '11 at 23:34
Well, looks like sending mail is a very insecure approach and hard to make it safe. I'll see what to do. – Tomas Jun 10 '11 at 4:09
up vote 4 down vote accepted

I'd recommend you install procmail or some other mail processor. You can configure it so everything from you, with a subject line of a certain magical password that only you know will pass the contents to a script (which you could then execute).

But... you're opening a huge security hole so it's unwise to do this as it's an unencrypted form of remote access to your server.

share|improve this answer

I'm a major developer of a new commercial tool Ales-U from alessoft.com which helps you to control servers/application using email. This tool is based on proprietary protocol which provides common method for identity verification of the person sending execution commands as well as for validation of the email headers. The tool controls all the operations on a Server Side and restricts the user to predefined set of actions he allowed to do. It doesn't require to download mobile application and can work from any email client. The protocol acts as a "status machine" which means that for each particular "Status" there is well defined set of messages the user is allowed to send. For example, for a WAIT status, the only "Start Dialog" command will be recognized. It can be used as a complementary tool for Mobile SSH client or other applications providing similar "remote control" solutions. To see more, you can visit the download area of the site and obtain documentation and presentation files. Actually I'm using Ales-U to contorl my server remotely almost every day, since I provide the System Administration, DBA and application support services to multiple companies and Ales-U helps me to easy control applications on my server when I'm far away...

share|improve this answer

Your Answer


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.