1

I have Ubuntu 12.04 installed and everytime I log in, I would like to see the previous IP addresses that logged in to my server. How would I go about doing this? I have fail2ban installed already.

sebix
  • 4,175
  • 2
  • 25
  • 45

2 Answers2

1

In your shell initialization script (e.g., ~/.bash_profile) add last --ip --limit 10

Mark Wagner
  • 17,764
  • 2
  • 30
  • 47
  • The arguments you suggest for `last` do not exist. However using `limit` without arguments usually provides the information asked for (after a rotation, one would need to check one earlier logfile as well.) – kasperd Aug 01 '14 at 18:40
  • Yeah, Precise uses a last from sysvinit-utils, version 2.88dsf-13.10ubuntu11.1. The one I use in gentoo: last from util-linux 2.24.2 – Mark Wagner Aug 01 '14 at 20:39
0

You should see a "Last login from IP" message everytime you login.

You could also use the command "history" to view a log of commands that have been used.

If you want to check the current logged in users, use the command "w"

Jose Flores
  • 113
  • 3