Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We would like to monitor the list of client machines (IP addresses, login, logout times) which connect (e.g. via ssh) into a Amazon EC2 | RDS instance

share|improve this question

2 Answers 2

The last -iF command is the one you want.

This list also includes local logins (at the console) as well as reboots. The actual data is stored in /var/log/wtmp.

If you want to know the last time each user logged in, try lastlog.

share|improve this answer

You can get the current connected machines with

 netstat -tnp|grep ':22'|grep sshd|awk '{print $5}'|cut -d':' -f1

the login, logut times of past clients you can get from the logs of your ssh server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.