LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-11-2012, 01:44 AM   #1
vahab
Member
 
Registered: Jun 2011
Posts: 58

Rep: Reputation: Disabled
Record vsftpd logins in /var/log/wtmp


Hi,

I was wondering if anyone could tell me if there is any way to record the users logins in /var/adm/wtmp just like SSH logins.
So we would be able to get the user login history with "last" command or get the last login time with "lastlog" command.

Please note that I don't want to user xfer log.

Thanks in advance

Last edited by vahab; 04-11-2012 at 03:05 AM.
 
Old 04-11-2012, 11:04 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by vahab View Post
any way to record the users logins in /var/adm/wtmp just like SSH logins.
The difference between OpenSSH and Vsftpd is that OpenSSH requires an account on the system and Vsftpd allows for virtual users: the latter are only known to the FTP service. Fortunately Vsftpd can use PAM so if you use a list of virtual users (see pam_listfile.so) then pam_lastlog.so might be able to silently update wtmp. If you can't get it to work minimally post your vsftp.conf (that is 'grep -v ^# vsftp.conf|grep .;') and tell us what you changed, your PAM stack for FTP and system and or daemon log excerpts showing errors (client side error messages will most likely not be useful).
 
Old 04-12-2012, 01:08 AM   #3
vahab
Member
 
Registered: Jun 2011
Posts: 58

Original Poster
Rep: Reputation: Disabled
I added a line to /etc/pam.d/vsftpd containing pam_lastlog.so as below and still I cannot find the ftp logins within 'last' or 'lastlog' commands

# cat /etc/pam.d/vsftpd
#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth required pam_shells.so
auth include system-auth
account include system-auth
session include system-auth
session required pam_loginuid.so
session required pam_lastlog.so

I am using RHEL 5.5 with its default vsftpd and default configurations :

vsftpd: version 2.0.5

# grep -v ^# /etc/vsftpd/vsftpd.conf|grep .;
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ftpd_banner=Welcome to FTP server
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
 
Old 04-12-2012, 01:45 AM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi vahab

I could only point you to logging vsftpd settings like this
where you will have to manually cat the log file for user logins.

good luck
 
Old 04-14-2012, 10:18 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by vahab View Post
still I cannot find the ftp logins within 'last' or 'lastlog' commands
From your config you seem to mix anonymous and local users. I hope you're not looking to logging anonymous users access? Are you saying you can't even 'last' or 'lastlog' local users?
 
Old 04-14-2012, 11:35 PM   #6
vahab
Member
 
Registered: Jun 2011
Posts: 58

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
From your config you seem to mix anonymous and local users. I hope you're not looking to logging anonymous users access? Are you saying you can't even 'last' or 'lastlog' local users?
I do not want anonymous logins.
And I cannot last or lastlog local users
 
  


Reply



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
VSFTPD causes strange message in /var/log/messages FeyFre Slackware 5 12-29-2011 11:41 AM
/var/log/messages and /var/log/cron not working sigkill Linux - Software 6 08-09-2008 01:08 PM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM
Centos 5 vsftpd /var/log/secure question johnvoisey Linux - Security 3 09-06-2007 06:45 AM
/var/log/packages and /var/log/setup sunny_5252 Slackware 4 05-17-2007 08:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:38 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
Open Source Consulting | Domain Registration