I have list of server names in the PuTTY saved sessions. I connected to one session and can know the IP address of the machine connected to using
ifconfig for Ubuntu and
ipconfig for Windows. But how to know the port number which has been used in to save those sessions in PuTTY while/after connecting?
echo "$SSH_CLIENT" but didn't get the right IP, so, the port might also be wrong.