-
Notifications
You must be signed in to change notification settings - Fork 36
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
support user password login ssh #129
Conversation
…uilder, create a TempDir.
Co-authored-by: Jiahao XU <[email protected]>
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files
|
if let Some(pass) = &self.password { | ||
let mut init = Command::new("sshpass"); | ||
|
||
init.stdin(Stdio::null()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we deduplicate the code here?
Most of the args provided are the same
/// If connecting requires interactive authentication based on `STDIN` (such as reading a | ||
/// password), the connection will fail. Consider setting up keypair-based authentication | ||
/// instead. | ||
/// password), consider use [`Session::connect_with_pass`] function instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// password), consider use [`Session::connect_with_pass`] function instead. | |
/// password), consider use [`Session::connect_with_pass`] function instead, though do note | |
/// that it passes the password via cmdline currently, | |
/// so it might leak your password to others | |
/// using the same machine and have privileges | |
/// to check /proc/$ssh_pid/cmdline |
@@ -60,6 +60,7 @@ pub struct SessionBuilder { | |||
user: Option<String>, | |||
port: Option<String>, | |||
keyfile: Option<PathBuf>, | |||
password: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO we can use zeroize here to avoid leaking the password.
/// optimized later. If using this feature, pay attention to security risks. | ||
/// | ||
/// For more options, see [`SessionBuilder`]. | ||
#[cfg(feature = "process-mux")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to put it under another feature "ssh-pass-login" since in the future we will implement this ourselves using pty, which will pull in additional features most don't use.
@baoyachi didn't you accidentally delete the repository? |
fixed: #119