LinuxQuestions.org
Review your favorite Linux distribution.
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 04-13-2011, 05:49 AM   #1
satya123
Member
 
Registered: Mar 2011
Posts: 31

Rep: Reputation: 0
Logging SSH in a separate file other than the regular /var/log/messages


Hi,

Generally SSH related log messages are logged in /var/log/messages file. Is there a way to log them in another different file? I mean is there some configuration setting to enable this?
 
Old 04-13-2011, 06:01 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

From the manpage of sshd_config:
Quote:
SyslogFacility
Gives the facility code that is used when logging messages from sshd(8). The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The
default is AUTH.
Then look at your syslog.conf / rsyslog.conf / ... to put in the rules to point to the logfile of your choice. Is that what you're looking for?

Kind regards,

Eric
 
Old 04-13-2011, 06:17 AM   #3
satya123
Member
 
Registered: Mar 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Actually, I am using syslog-ng for logging. And there is no default Audit message for SSH like AuditFTPDaemon.
 
Old 04-13-2011, 06:29 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,362

Rep: Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377
Typical ssh log msg locations are in /var/log/messages, /var/log/secure, /var/log/audit/audit.log
 
Old 04-13-2011, 06:54 AM   #5
satya123
Member
 
Registered: Mar 2011
Posts: 31

Original Poster
Rep: Reputation: 0
yeah..

but my question was is there a way to log SSH messages in another location other than the regular ones.

Or maybe i should rephrase my question and ask how to log SSH messages in a different location while using syslog-ng
 
Old 04-13-2011, 07:01 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

OK, that's a bit clearer. Have a look at this link. It's a bit outdated and for Suse but I guess you can get what you need from there.

Kind regards,

Eric
 
1 members found this post helpful.
Old 04-13-2011, 07:40 AM   #7
satya123
Member
 
Registered: Mar 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Thanks a lot Eric.
That was the exact solution.
 
Old 04-13-2011, 07:43 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Glad to be of assistance! Nice to hear you've got a solution. Have fun with Linux.

Kind regards,

Eric
 
  


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
Logging a to /var/log/messages using python heeman Linux - Newbie 1 03-25-2011 01:10 PM
segfaults are not logging into /var/log/messages ravikumarv Linux - General 1 12-10-2010 08:20 AM
no ssh logging in /var/log/secure mberd Linux - Security 4 05-27-2009 07:55 AM
Logging to /var/log/messages paddyjoy Programming 5 12-19-2005 06:01 AM
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 06:39 PM


All times are GMT -5. The time now is 06:22 PM.

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