云主机查看登录ip和本机出口ip
Linux查看登录IP地址
who
[root@test-host ~]# who
root pts/0 2021-03-06 18:00 (#登录IP地址)
netstat -lnta
ss -lnta
[root@tes-thost ~]# netstat -lnta
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 172.26.76.25:47496 100.100.30.25:80 ESTABLISHED
tcp 0 36 172.26.76.25:22 #登录IP地址:17407 ESTABLISHED
tcp 0 0 172.26.76.25:54930 100.100.0.5:443 TIME_WAIT
Linux查看出口IP
curl http://members.3322.org/dyndns/getip
[root@test-host ~]# curl https://www.ipip.net/ --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"
| grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"
windows查看登录IP地址
netstat -ano | findstr "3389"
windows查看出口IP地址
百度搜索 IP 即可
或者直接访问:http://members.3322.org/dyndns/getip