Posts tagged client ip

Get IP address of the client in an SSH session

echo $SSH_CLIENT | awk '{ print $1}'
echo $SSH_CONNECTION | awk '{ print $1}'
who am i | awk '{print $5}' | sed 's/[()]//g'