Have to disagree there a bit considering the fact that FreeBSD doesn't even use
/etc/issue.
Even
/etc/ssh/sshd_config makes this really clear with the
PrintMotd option (see also
sshd(8)).
Anyway, I'd look into login.conf(5) instead, specifically the login_prompt string. I don't know from mind (yet) how (and if) you can change that, but I'd start there. Especially considering the default login string in which it shows the current hostname. Can't help wonder if that can't be swapped for an IP address.
(edit):
Well, that was obviously a small mistake but that's what I get when I focus too much on one subject. The answer here is
gettytab(5), see also
/etc/gettytab. That defines the actual login string (I should have known considering that I'm well aware of the existence of
getty):
Code:
93878 v1 Is+ 0:00.00 /usr/libexec/getty Pc ttyv1
1885 v2 Is+ 0:00.00 /usr/libexec/getty Pc ttyv2
1886 v3 Is+ 0:00.00 /usr/libexec/getty Pc ttyv3
1887 v4 Is+ 0:00.00 /usr/libexec/getty Pc ttyv4
1888 v5 Is+ 0:00.00 /usr/libexec/getty Pc ttyv5
1889 v6 Is+ 0:00.00 /usr/libexec/getty Pc ttyv6
1890 v7 Is+ 0:00.00 /usr/libexec/getty Pc ttyv7
Anyway....
Looking into
gettytab learns me that the login prompt is defined using
im=. It even has codes which you can use, as seen by the default:
Code:
default:\
:cb:ce:ck:lc:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:\
:if=/etc/issue:
And there's also
/etc/issue But according to
gettytab(5) this option is unused. It's also where I based my previous comment on.
Anyway, the only character sequences I managed to find were
%d (current date & time),
%h (hostname),
%t (tty name),
%m,
%r,
%s,
%v (machine type, OS release, OS name, kernel version) and
%% to get a literal %.
Now, here's where it becomes a little bit interesting: the hostname is normally obtained from
gethostname(3) but it seems you can override it using the
hn entry and edit it using the
he string.
SO... My suggestion is to set something like in
/etc/gettytab:
Code:
default:\
:cb:ce:ck:lc:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:\
:if=/etc/issue:hn=127.0.0.1
This will effectively replace the hostname in the login prompt with the IP address (127.0.0.1 in my example).
Do note that this is not dynamic. After all: in order for
/etc/gettytab to get refreshed / become active you'd have to restart the
getty daemon first. This is the other reason why I don't really see much use in some kind of dynamic
/etc/issue file, because it would only apply to restarted listeners.