FreeBSD

Users Logged Into Server

This article explains on how to identify those who you do not know that are on your server. This can definitely eliminate the curiosity that people can have when taking care of your server. I can relate to you guys, because I, myself have a server. It is IMPORTANT always monitor your server in case someone gets int your server ‘though the backdoor.’

Note: The commands below can also work with Linux


Display who is on the server

You can display whoever is on the server by the commands below:

$ who

$ who | less 

In case you know specifically who is on, use a grep command below:

$ who | grep renriquez

 

Once Identified, you are able to see what they are doing below:
$ w
The w command is very helpful to identify who has logged into a server.

After you inserted the w command, a list will appear. The w command is very useful because it views specifically who has logged in, what time, what date, and what did they log in as.

Code is below:

12:56PM up 38 days, 20:21, 3 users, load averages: 0.03, 0.03, 0.00
USER TTY FROM LOGIN@ IDLE WHAT
root v0 – 12Dec14 38days -bash (bash)
root pts/0 renriquez.webair.co Mon06PM 1:59 -bash (bash)
root pts/1 renriquez.webair.co 12:56PM – w

 

The last utility command to display a list the sessions for:USERS, TTYS
and HOST, in reverse time order, OR list USERS that are logged in included with the date and time.

$ last
$ last root

Related Articles

  • Identify the process that is using some specific port

    Sometimes, you may encounter a situation where you see some ports being used by some service, but you cannot exactly determine which application/service is using it. This article talks about how...
  • A Basic Overview of the Vim Text Editor

    Many articles in our Webair Community advise editing configuration files. We usually recommend using your preferred text editor. I personally prefer vim. Vim, or its older sibling vi, are installed...
  • How to List Compiled PHP Modules from the Command Line

    The general command is php -m; this command will give you the full list of extensions: php -m This command will give you an output like: bz2 calendar Core ctype...
  • SSH: Whitelist IPs for Your Server

    If you wish to whitelist certain IP’s for your server for any reason, you can easily go into your Webair Ezpanel for this. When whitelisting an IP, please provide the specific...