LinuxQuestions.org
Visit Jeremy's Blog.
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 09-09-2005, 05:41 PM   #1
stomach
Member
 
Registered: Sep 2005
Distribution: Debian
Posts: 202

Rep: Reputation: 30
Apache, to show login user


It has as to show the name of the user who effected login in a restricted page with apache (htaccess)?
 
Old 09-09-2005, 08:24 PM   #2
Snowbat
Member
 
Registered: Jun 2005
Location: q3dm7
Distribution: Mandriva 2010.0 x86_64
Posts: 338

Rep: Reputation: 31
Yes. You'll find them in your access_log with htuser name appearing instead of -

Unprotected access:
192.168.1.4 - - [09/Sep/2005:21:18:17 -0300] "GET

Access by authenticated htuser 'stomach'
192.168.1.4 - stomach [09/Sep/2005:21:18:16 -0300] "GET
 
Old 09-09-2005, 08:54 PM   #3
Snowbat
Member
 
Registered: Jun 2005
Location: q3dm7
Distribution: Mandriva 2010.0 x86_64
Posts: 338

Rep: Reputation: 31
You can use awk to display only htusers and what they accessed (change path as needed):
awk '$3 !~ /-/ {print $1,$3,$6,$7 }' /var/log/httpd/access_log

For logrotate users with access_log.1, access_log.2 (non-gzipped), you can use this (change path as needed):
for i in /var/log/httpd/access_log*; do awk '$3 !~ /-/ {print $1,$3,$6,$7 }' $i; done

Last edited by Snowbat; 09-09-2005 at 08:57 PM.
 
  


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
Show Login Screen on SuSE 9.2 Zakirium Linux - Newbie 2 01-17-2006 02:44 PM
show last users login wisdom Programming 3 11-17-2005 03:56 AM
show motd on login pirozzi Debian 11 12-15-2004 11:40 AM
Gnome installed, but won't show up at login screen Crysm Linux - Software 0 06-02-2004 10:09 AM
Show Uptime On Shell Login~ skate Linux - Software 2 09-09-2003 01:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:15 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