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

Add Session.userauth_banner #277

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ScottCUSA
Copy link

@ScottCUSA ScottCUSA commented Dec 15, 2022

Implements #275

Add a method retrieve the ssh userauth banner. Returns the SSH_MSG_USERAUTH_BANNER message sent by the server.
Will return [Session(-50)] missing userauth banner if user auth hasn't yet been attempted.

  let auth_methods = session.auth_methods(user)?;
  
  if let Some(ret) = session.userauth_banner()? {
      println!("{}", ret);
  };    

Example:

---------  AT&T IP Services Route Monitor  -----------

The information available through <snipped> is offered
by AT&T's Internet engineering organization to the Internet community.

This router maintains eBGP peerings with customer-facing routers
throughout the AT&T IP Services Backbone:
...

@ScottCUSA ScottCUSA changed the title #275 add Session.userauth_banner !275 add Session.userauth_banner Dec 15, 2022
@ScottCUSA ScottCUSA changed the title !275 add Session.userauth_banner Add Session.userauth_banner Dec 15, 2022
@yodaldevoid
Copy link
Collaborator

This seems good so far. Would you be able to add a test?

@ScottCUSA
Copy link
Author

ScottCUSA commented Mar 12, 2023

This seems good so far. Would you be able to add a test?

I haven't been able to validate the test, but I think it should be good. There might be a path issue to the banner file.

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

Successfully merging this pull request may close these issues.

3 participants