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

userauth_pubkey_memory() not working. #284

Open
Strange21 opened this issue Feb 28, 2023 · 0 comments
Open

userauth_pubkey_memory() not working. #284

Strange21 opened this issue Feb 28, 2023 · 0 comments
Labels

Comments

@Strange21
Copy link

Strange21 commented Feb 28, 2023

Hi I am facing an issue with ssh2 crate, while trying to login to aws EC2 instance using the private key.
The following code is panicking.

sess.userauth_pubkey_memory(&username, None, private_key, None).unwrap();

With following error

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: Session(-14), msg: "Error parsing PEM: offset out of bounds" }', src/main.rs:71:69
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

using version: 0.9.4
I am able to login to the ec2 instance while using the userauth_pubkey_file(), by providing the path to the privatekey file

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

No branches or pull requests

2 participants