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

Trending Topics

Online now

Members online
1,085
Guests online
12,820
Total visitors
13,905

Forum statistics

Threads
2,360,817
Posts
29,407,702
Members
1,060,000
Latest member
micamica
Back
Top