Linux command line trick to get the public IP of a machine

For the handful of people who have ever needed to ascertain the public IP of a computer to which they only have SSH access available, use this:

curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'  

 

It’s effective and glorious!

Leave a Reply

Your email address will not be published. Required fields are marked *

Facebook Auto Publish Powered By : XYZScripts.com
x Shield Logo
This Site Is Protected By
The Shield →