Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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.