cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Commander Commander
Commander
  • 995 Views

SSH Connection Info

Have you ever had a need (or want) to see the IP address and port number information associated with an ssh connection to your Linux system?  When I've wanted to look at this information, I just used

              $  ss  -t

Nothing fany!  Provides me the IP/port number for the source of the SSH connection, as well as the destination of the SSH connection.

Are you familiar with the following shell environment variables:

     -   SSH_CONNECTION

     -   SSH_CLIENT

Have a look at the output of the following commands - you'll be able to see where I'm going with this:

 echo   $SSH_CONNECTION

$   echo   $SSH_CLIENT

 

As the saying goes, there's more than one way to skin a cat    

 

Trevor "Red Hat Evangelist" Chandler
2 Replies
Blue_bird
Starfighter Starfighter
Starfighter
  • 981 Views

Thanks for sharing..!

Trevor
Commander Commander
Commander
  • 964 Views

Thank you for viewing!!!

Trevor "Red Hat Evangelist" Chandler
Join the discussion
You must log in to join this conversation.