Solved

Linux Fedora Core - SSH logs??

Posted on 2006-12-01
12
1,080 Views
Last Modified: 2013-12-06

Can someone provide me with a step by step guide on how to record user actions and authentications (possibly logging access denied and user granted) using SSH on Fedora Core.

I’ve been through /var/logs/ and there doesn’t seem to be anything obvious that I can view!

Any suggestions would be much appreciated, thanks!
0
Comment
Question by:the_omnific
  • 5
  • 4
  • 3
12 Comments
 
LVL 4

Expert Comment

by:wbstech
Comment Utility
You need to be looking for:

/var/logs/sshd
/var/logs/secure

Could you post up /etc/syslog.conf from your Linux machine?

That's where you'll need to add it. Once you post it up, i'll be able to post it back with the required additions. Or tell you where it is, if already there.
0
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
you can only see who logged in and out from /var/log/secure.  what do you mean by recording user actions???  i do not think that you can record something of that nature like capturing every command issued and stuff like that.
0
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
once you see the user logging in and out, you can probably get the information on the set of commands issued by the user from

/home/user_name/.history

that file will show all commands issued by the user (atleast 1000 commands), but will not give you any idea about when the commands were issued.
0
 
LVL 4

Expert Comment

by:wbstech
Comment Utility
Didn't fully grasp what you were asking there. Yeh ygoutham is right; the logs aren't going to record everything. Just authentication and errors really.
0
 
LVL 1

Author Comment

by:the_omnific
Comment Utility
this is my syslog.conf.......

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                          /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none            /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                    /var/log/secure

# Log all the mail messages in one place.
mail.*                                          -/var/log/maillog


# Log cron stuff
cron.*                                          /var/log/cron

# Everybody gets emergency messages
*.emerg                                          *

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                    /var/log/spooler

# Save boot messages also to boot.log
local7.*                                    /var/log/boot.log
0
 
LVL 1

Author Comment

by:the_omnific
Comment Utility
i just thought it might have been interesting to view the logon attempts....i dont necessarily require the need to know every command a user performs once they have access. It would just be nice to know what was going on etc.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 4

Expert Comment

by:wbstech
Comment Utility
Try running:

cat /var/log/secure

I think they should already be in there.
0
 
LVL 1

Author Comment

by:the_omnific
Comment Utility
Thanks, there seems to be all sorts of logon information in there including ftp etc. Is there any way of creating a separate log file solely for SSH?
0
 
LVL 14

Assisted Solution

by:ygoutham
ygoutham earned 125 total points
Comment Utility
you can try

cat /var/log/secure | grep sshd

which should filter only sshd related info. but again you have only ipaddresses and times, with some stuff on public key acceptance and other things. it also have the user name between ACCEPTED PASSWORD FOR XXXXXX from x.y.z.a

look through that and the history should give some specific idea
0
 
LVL 4

Accepted Solution

by:
wbstech earned 125 total points
Comment Utility
Try adding the below to the end of the syslog.conf:

#Save only auth info to authinfo.log

authpriv.info                                          /var/log/authinfo.log


Or, you could do the above suggestion and just put "cat /var/log/secure | grep sshd" in a file as below:

echo "cat /var/log/secure | grep sshd" > /usr/bin/showsshdlogs

Then you have in a sense made your own command to show what you need. You can just type "showsshdlogs" at the command prompt and see it all.
0
 
LVL 1

Author Comment

by:the_omnific
Comment Utility
Thank you very much. Both of you have been very informative!
0
 
LVL 4

Expert Comment

by:wbstech
Comment Utility
No problem :-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Amazon EC2 Instance with EBS Block attached 1 78
Open Camera IP 8 91
Virtual Box issue 6 49
Mysql Crashing Intermittently 16 34
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now