👨‍🏫 Tutorial Basic Linux command to check who is connected to your SSH server.

R3g4z4k1

Established

SSH sets the environment variable SSH_CONNECTION to contain client IP address, client port number, server IP address, and server port number seperated by spaces.

You can use

echo ${SSH_CONNECTION%% *}

to get the client's IP address. To get the DNS name use something like host or dig -x:

host ${SSH_CONNECTION%% *}


dig -x ${SSH_CONNECTION%% *}

Sample Screenshot:

1715005060290.png


Thank you for your support!
Keep Learning!
Keep going!

Follow for more updates!
 

About this Thread

  • 1
    Replies
  • 626
    Views
  • 2
    Participants
Last reply from:
Umbrellaz

Trending Topics

Online now

Members online
1,260
Guests online
3,374
Total visitors
4,634

Forum statistics

Threads
2,337,596
Posts
29,298,868
Members
1,127,642
Latest member
ggbetrivalry
Back
Top