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

  • Setting files as immutable.

    Wouldn’t it be nice if we can set files so that even root cannot modify or delete it ? Both FreeBSD and Linux come with commands that allows us to...
  • Identifying malicious mail scripts on FreeBSD

    This article will help you identify an possible spam scripts that may be causing unwanted outbound mail which could cause your servers ip address to be blacklisted.There are many different...
  • Media tools installation Error/Fix

    While installing media tools like Neroacc, we might come across the following errors   ERROR: ====== /usr/ports/audio/linux-neroaaccodec]# make install clean ===>  Staging for linux-neroaaccodec-1.5.1 ===>   linux-neroaaccodec-1.5.1 depends on file: /compat/linux/etc/redhat-release...
  • Get CPU Information

    You can use the dmesg utility to display the contents of the system message buffer when FreeBSD comes up. For accuracy I recommend querying /var/run/dmesg.boot file. Usually a snapshot of...