I have "Banner /etc/motd" and "UsePrivilegeSeparation yes" in my sshd configuration. When I "ssh localhost", I get: $ ssh localhost krh@localhost's password: Last login: Sun Apr 28 17:29:10 2002 from localhost.lemniscate.net $ as if I had no banner. Turning off UsePrivilegeSeparation fixes this; the banner comes up like it's supposed to. I only have ix86 OpenBSD systems to test this against, but I suspect it's not limited to them.
I should add that I also have PrintMotd off so that the motd is printed only once, and yes, I am connecting with the SSH 2 protocol.
currently, with privsep on, the banner file needs to be in /var/empty. so if your banner is /etc/issue, you need /var/empty/etc/issue.
Created attachment 91 [details] Make Banner work with privsep as expected
Could you please try the attached patch?
That diff looks good to me. I can not test right now, but it is the right approach.
The patch does not apply cleanly to any snapshot between April 27 and April 30. Applying it by hand doesn't help, because whether or not I do that, the compile fails with: readpassphrase.c: In function `handler': readpassphrase.c:183: `signo' undeclared (first use in this function) readpassphrase.c:183: (Each undeclared identifier is reported only once readpassphrase.c:183: for each function it appears in.) readpassphrase.c: At top level: readpassphrase.c:181: warning: `handler' defined but not used
Thanks - the fix for that will be in the next snapshot. If you are impatient, you can edit openbsd-compat/readpassphrase.c and move the "#endif" from below the readpassphase() function (~line 168) to the end of the file.
Well, to get the May 1 snapshot to compile, I had to edit config.h and manually undefine HAVE_READPASSPHRASE, and I had to edit readpass.c and include openbsd-compat/readpassphrase.h. Otherwise the compile fails at readpass.c:101 with RPP_ECHO_{ON,OFF} and RPP_REQUIRE_TTY undefined. But once I did that (and I'm sure it's not the Right Thing, because sshd didn't recognize the keywords KerberosAuthentication and AFSTokenPassing in sshd_config), everything compiled and Banner worked with UsePrivilegeSeparation. Thanks!
I'll reopen the bug until the fix gets committed. Could you please file a seperate bug for the readpassphrase problem?
Patch committed
Mass change of RESOLVED bugs to CLOSED