👨‍🏫 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
  • 619
    Views
  • 2
    Participants
Last reply from:
Umbrellaz

Online now

Members online
1,109
Guests online
3,446
Total visitors
4,555

Forum statistics

Threads
2,324,868
Posts
29,226,009
Members
1,170,894
Latest member
INTERLIX
Back
Top