Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 and login logging

I have set up several EC2 instances and intend to give multiple users access to them via SSH. Is there any file on the server that monitors who logs in and when?

Any help greatly appreciated.

Max.

like image 711
user7289 Avatar asked Dec 28 '09 00:12

user7289


2 Answers

None of the suggested answers here (except the last command) applied on Amazon Linux. I found SSH attempts and logins, as well as privilege escalations, in /var/log/secure.

like image 144
Jeremy Avatar answered Oct 13 '22 21:10

Jeremy


In addition to the auth log Daniel mentioned, assuming you're using Linux on your EC2 instance (which is likely), see:

  • the last(1) command, which reads /var/log/utmp
  • the utmp(5) file formats and the getutent() C function.
like image 41
Brian Clapper Avatar answered Oct 13 '22 22:10

Brian Clapper