Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress login banner #58

Open
StyopinN opened this issue Dec 27, 2023 · 1 comment
Open

Suppress login banner #58

StyopinN opened this issue Dec 27, 2023 · 1 comment

Comments

@StyopinN
Copy link

Is there any way to suppress banner on login?

Something like -o LogLevel=error or -q option for OpenSSH Client.

I'm trying to parse command output from some remote hosts and sometimes there is unexpected banners.

For example, I want to check OS version on remote host by lsb_release -d command. And I no need to have banners in output.

import com.decodified.scalassh.SSH
import com.decodified.scalassh.HostConfig

val hostname: String = ???
val hostConfig: HostConfig = ???

SSH(hostname, hostConfig) { client =>
   client.exec("lsb_release -d").map { res: CommandResult =>
      val errStr = res.stdErrAsString().trim
      val outStr = res.stdOutAsString().trim   // I have banner in outStr, but I don't want it. Expected only output of "lsb_release"
      ...
   }
}
@sirthias
Copy link
Owner

sirthias commented Jan 4, 2024

AFAIK there is currently no facility for this.
But you could check/ask the upstream dependency, which should be replace with https://github.com/mwiede/jsch anyway (see #59). If there is something there that allows for banner suppression it should be easy to provide here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants