LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-03-2006, 08:35 AM   #1
celejar
Member
 
Registered: Oct 2003
Location: New York
Distribution: Debian Sid
Posts: 185

Rep: Reputation: 30
An app for remote system admin via email?


I'm looking for an application to handle remote system administration of a linux box via email. The box will only connect to the internet intermittently to pull in mail, so remote admin via ssh or webmin isn't a satisfactory option. I need something that can read mail (presumably checking pgp / gpg signatures for authentication) and execute commands contained therein. I have googled but not found anything suitable. Anyone have any ideas?
 
Old 01-04-2006, 02:00 AM   #2
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 31
I would just pipe all email to a specific address, into a script that parses the file for commands.

Here's a weak example:
contents of email:
Quote:
From: somebody@somewhere.com
To: commandparser@yourdomain.com
Date: 01/01/2006
Subject: (empty)

command=/usr/local/backup.sh daily
command=/usr/bin/mail friend@somewhere.com < ~me/email.txt
The script may look like
Code:
#!/bin/sh

cd ~me/tmp
cat > ./email.txt
for i in `cat ./email.txt`; do
 NEWCMD=`echo $i | grep -w command | sed 's/.*=//'`
 ## Could also do the following
 ## NEWCMD=`echo $i | grep -w command | awk -F'=' '{print $2}'`
 $NEWCMD
done
It's just a basic example. I'll leave the rest up to you. Be ABSOLUTELY sure you secure it to avoid A LOT of trouble.
 
Old 01-04-2006, 03:05 PM   #3
celejar
Member
 
Registered: Oct 2003
Location: New York
Distribution: Debian Sid
Posts: 185

Original Poster
Rep: Reputation: 30
Thanks! I realized I could do it with scripts, but I was indeed worried about security - it is far to easy to make mistakes. I also have almost no experience writing my own scripts (shell or perl). Additionally, there's no point in reinventing the wheel and I assume someone has already done this before, so I'd still like to hear from anyone who knows of such an app.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote admin via email. carboncopy Linux - Software 1 12-04-2004 09:21 PM
Email remote admin bananaman Linux - Newbie 1 05-17-2003 01:53 PM
Remote Admin... kobe Linux - General 1 08-09-2002 08:52 AM
Checking Email from remote System Archangelkn Linux - Newbie 10 04-15-2002 07:32 PM
Remote admin. How? Q25 Linux - General 5 05-17-2001 03:02 PM


All times are GMT -5. The time now is 03:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration