Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 03-16-2011, 06:26 PM   #1
LQ Newbie
Registered: Mar 2008
Location: California
Distribution: FreeBSD/CentOS/Ubuntu/Gentoo
Posts: 15

Rep: Reputation: 0
SFTP Email notification on login

I've not been having any luck at all finding the answer to this, so thought I'd ask here: is there any way to get my servers to send an email when someone logs in through SFTP? I was able to get that to work with SSH using a simple bit of script in /etc/profile, but I can't find anything on Google about doing that with SFTP at all.

The OpenSSH version on my server is 5.2p1 running on FreeBSD 8.0. Any way to get the server to execute any command on SFTP login will be enough for me to get this set up.

Any help is very much appreciated.
Old 03-17-2011, 04:53 PM   #2
Registered: Apr 2010
Posts: 243
Blog Entries: 2

Rep: Reputation: 31
Monitor the log and send mail on new connections.
1 members found this post helpful.
Old 03-18-2011, 12:15 AM   #3
LQ Newbie
Registered: Mar 2008
Location: California
Distribution: FreeBSD/CentOS/Ubuntu/Gentoo
Posts: 15

Original Poster
Rep: Reputation: 0
Originally Posted by timetraveler View Post
Monitor the log and send mail on new connections. know what? As much of a pain as that sounds like it could be, I think it is probably dead on. I'll give that a try...thank you!

I don't know why I didn't think to try that...
Old 03-18-2011, 07:31 AM   #4
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 13.1
Posts: 1,329

Rep: Reputation: 254Reputation: 254Reputation: 254
I don’t know whether it will work on FreeBSD: what about using pam_warn to write a line to the syslogd, and the log daemon will send an email for this specific application (sftp) in this case. In Linux the syslog-ng has also a "program" destination (instead of just writing it to a file) for the message which is feed to it. The program destination could be a loop reading the actual line and send it out.


freebsd, notification, sftp

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 for FTP Login? Panicker Linux - Newbie 5 01-27-2009 07:15 AM
cannot login into SFTP server using Net::SFTP cccc Programming 1 10-31-2007 07:23 AM
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 jeremy LQ Suggestions & Feedback 6 11-07-2002 02:16 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:54 PM.

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