Display IP address in console login screen

2018-04-30 1 min read Learning

Here is one liner that will add the current IP address in the console login screen (if you are not running X as is case for servers):

(ip -o -4 a| awk '$2 !="lo" {print "\nIP Address ::"$4}' |tr '\n' ',';echo)>>/etc/issue

Just execute the above command as root. It will add the required code in “/etc/issue” to display the IP address. BTW, you can also use “\4” or “\6” instead of that command to get the IP but that will not work with some old versions of Linux.

comments powered by Disqus