Checking Active Connections

GEEKS !!

You are managing your Linux server using the skills you have learned in RHCE or RHCSS training and now want to check who over the network is accessing your Linux server services.

You can use netstat or lsof command with ease to check that activity.

Here I have used the netstat command with –inet option to check the active connections.

Secondly, you can use the lsof command to check for particular type of active connections.

Here I have used the -i option to choose a particular type of network connection.

The -i option can be followed by an argument of the form [TCP|UDP][@host][:port] to select specific network connections any or all of the components can be omitted. For example, to view all ssh connections (which use TCP), to or from any machine:

# lsof -iTCP:ssh

Below is the illustrated example from my machine.

netstat and lsof for monitoring active connections

netstat and lsof for monitoring active connections

 

 

Advertisements