Languages
[Edit]
EN

Linux / Bash - list users IPs connected to HTTP or HTTPS server

10 points
Created by:
Mark-Rotteveel
537

In this short article, we would like to show how to easily display the IPs of all connected users to our HTTP or HTTPS server under Linux (Debian / Ubuntu, etc.).

Quick solution (type in the command line):

Where:

  • -n causes displaying used ports as numbers (service names are not resolved),
  • state established causes displaying only established connections,
  • src :80 or src :443 causes displaying only ports: 80 or 443 - ports where we have run our servers.

Example output:

Where:

  • Netid - socket type (e.g. TCP, UDP, etc.),
  • Recv-Q - number of received packets in the queue,
  • Send-Q - number of sent packets in the queue,
  • Local Address:Port - local machine address and port,
  • Peer Address:Port - remote machine address and port (it indicates connected user IP).

Warning: it is good to do not use netstat command because it is marked as deprecated.

 

Watching mode

Edit

We can monitor connected users with watch -n N command.

Where:

  • watch -n 1 causes state refreshing once per 1s.

Alternative titles

  1. Linux / Bash - display users IPs connected to HTTP or HTTPS server
  2. Linux / Bash - show users IPs connected to HTTP or HTTPS server
  3. Debian / Bash - show users IPs connected to HTTP or HTTPS server
  4. Ubuntu / Bash - show users IPs connected to HTTP or HTTPS server
  5. Linux / Bash - list each user IP address that is connected to HTTP or HTTPS server
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join