Skip to content

Suppress login banner #58

@StyopinN

Description

@StyopinN

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"
      ...
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions