3
1
I work with a lot of virtual machines. For testing and preproduction set up.
I would like the login promt or header to display the ip address of the machine. That way when I start it up I can see what IP I will be ssh into. Our network works uses a DHCP. So it can change between boot up.
$ cat /etc/issue
Ubuntu 11.04 \n \l
Which comes up as
Ubuntu 11.04 [hostname] tty[x]
I want it to come up as
Ubuntu 11.04 [hostname] tty[x] ip xxx.xxx.xxx.xxx
I was think about writing an init / upstart script. Is there a better way.
Why would someone need to look at the IP address of a remote system after having connected to that system? (that's on the question of modifying the
/etc/issue.net
) – Alexander Shcheblikin – 2014-03-07T21:06:08.670If you have one hundred servers, and your .ssh/config is configured to distinguish them by hostname, I believe it would be handy to know it's IP address for administration purposes. It's just one of the use cases.. – Andrejs Cainikovs – 2014-03-10T08:20:57.230
The IP address can be just looked up with
host
. However, I'd agree that some complex NAT configurations might make a simple lookup not that useful. – Alexander Shcheblikin – 2014-03-10T12:05:29.767