Admin stuff

Posted by on 11-11-24 15:32

How do you know who's logged in to your Linux/Unix server?
It's actually pretty simple:
Go to the terminal and type "w" or "who" followed by <return> - then you will get a list of active users and the IP address they had at login.
If you want to know who has been logged in during a given period, you can use
'last' in the terminal.

$ last -s "-3 weeks"

will give you an overview of users who have been logged in for the past 3 weeks.

$history

will give you a summary of the most recently executed commands. You can then choose to pass the output on to 'less' or 'grep' to search more in-depth.

$ history | grep -i "ssh"

gives you an overview of used ssh commands

You can always look in the man(ual) to see what other options you have with a command.

$ man who

Have a nice weekend :-)