shikhar/sshj — Issue #45: Not getting pre-login banner
Author: haebler
Created: 2011-12-09 11:15:27+00:00
State: open

Summary: Cannot get the pre-login banner from my RHEL 5 & Centos 5 servers.

Remote systems: RHEL 5 & Centos 5 systems running OpenSSH 4.3p2.
Remote sys config: Password based authentication - default RHEL 5 / CentOS 5 w/ "Banner /etc/ssh/sshd_banner.txt" config in /etc/ssh/sshd_config. The file sshd_banner.txt is a simple text file.

Description:
I am trying to get the banner multiple times during the different stages of session startup and even before teardown using
ssh.getUserAuth().getBanner() where ssh is an instance of SSHClient.

The getBanner() method always comes back as "" instead of the null that is mentioned in the documentation:
https://github.com/shikhar/sshj/blob/master/src/main/java/net/schmizz/sshj/userauth/UserAuth.java#L52

That is because it is initialized to "" here: https://github.com/shikhar/sshj/blob/master/src/main/java/net/schmizz/sshj/userauth/UserAuthImpl.java#L46

The documentation issue is a minor one at this point. I can see the banner fine with the openssh client. I tried JSch as well and the banner is available when connecting with JSch.

At this point I am not even sure, that the banner is actually sent when connecting with sshj. Before I spend more time on debugging this problem further, I want to make sure I am not missing something. Anyone else having problems with this?