LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2009, 02:38 PM   #1
Panicker
LQ Newbie
 
Registered: Jan 2009
Posts: 8

Rep: Reputation: 0
Email notification for FTP Login?


Hello,

Can someone point me to the right direction on how i can do the following:

An email notification (say to my blackberry) is sent everytime a specific user has logged into FTP? Or a file uploaded to directory. But it needs to be as close to real time as possible.

Something in the lines of the simple ssh email i get when root logs in.

PURE-FTPD / RHEL3 / Cpanel etc etc etc.
 
Old 01-25-2009, 05:17 PM   #2
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 307

Rep: Reputation: 38
You'll need mod_exec from here.

You could just use sendmail to send the email, you'll find plenty of simple one liners for that.

Let me know if you need more detailed help.
 
Old 01-25-2009, 05:22 PM   #3
Panicker
LQ Newbie
 
Registered: Jan 2009
Posts: 8

Original Poster
Rep: Reputation: 0
What you mean by use sendmail?

All i need it to do is send an email to me (regardless of what way it does that) once a person connects to FTP.

Seems simple enuff but for the life of me I can't get any good examples of this
lol

Any help would be appreciated - I'll look into your suggestion aswell.

Thanks
 
Old 01-26-2009, 05:21 AM   #4
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,497

Rep: Reputation: 90
Quote:
What you mean by use sendmail?
I. e. you can send a message from a shell script with sendmail. You call it just like any other binary, and it will send an email. This is a logical example, it won't actually work (I can't remember all the parameters right now...!)

Code:
#somescriptcode...
#somescriptcode...
sendmail -t me@somewhere.com "Someone logged in"
#somescriptcode...
#somescriptcode...
 
Old 01-26-2009, 08:10 AM   #5
Panicker
LQ Newbie
 
Registered: Jan 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rylan76 View Post
I. e. you can send a message from a shell script with sendmail. You call it just like any other binary, and it will send an email. This is a logical example, it won't actually work (I can't remember all the parameters right now...!)

Code:
#somescriptcode...
#somescriptcode...
sendmail -t me@somewhere.com "Someone logged in"
#somescriptcode...
#somescriptcode...
Right, but that's a little hard for someone who just started running linux - Don't get me wrong,I can handle my own and stuff if there's documentation, but if peeps just keep throwing out suggestions I won't be able to learn.

So with that being said, anybody got a link or a sample code so I can look at and adjust?

Thanks
 
Old 01-27-2009, 07:15 AM   #6
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,497

Rep: Reputation: 90
Ok, I would then suggest first taking a good look at mod_exec (see above) and once you have something there that works, and gets triggered correctly when somebody logs into FTP, only THEN go the distance and start looking into how to get an email out.

If (as I suspect, I know nothing about mod-exec) you eventually get to a point where you can have a script called if somebody logs in, getting a call to sendmail into that script should not be at all difficult.

I'm assuming of course you know what shell scripting is in linux?

I have done something similar, but in PHP - I send email based on a script triggered by cron. Cron is just an application that you can tell "run this each hour" or "run that each day" etc. In my case cron calls a shell script that calls PHP to do daily processes on a database, then emails me if successful.

This might have relevance to your problem since I suspect mod_exec will do the "run this if somebody logs into ftp" bit - the rest you might be able to do similarly...

If you want more info on this, respond and I'll work an explanation up.

Last edited by rylan76; 01-27-2009 at 07:18 AM.
 
  


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
email notification mbegovic LQ Suggestions & Feedback 6 04-01-2004 01:36 PM
New Email Notification lapthorn Linux - Software 0 02-04-2004 10:44 AM
Email Notification ezra143 LQ Suggestions & Feedback 6 01-12-2004 11:17 AM
Email notification jeremy LQ Suggestions & Feedback 6 11-07-2002 02:16 PM
email notification elainepearl Linux - General 1 01-14-2002 06:58 AM


All times are GMT -5. The time now is 02:24 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration