mirror of
https://github.com/wez/wezterm.git
synced 2024-11-30 06:03:39 +03:00
ssh: fix for sites that use 2fac
This commit is contained in:
parent
b59893fd9f
commit
8eb5a0e72c
@ -279,13 +279,17 @@ pub fn ssh_connect(remote_address: &str, username: &str) -> anyhow::Result<ssh2:
|
||||
}
|
||||
}
|
||||
|
||||
let methods: HashSet<&str> = sess.auth_methods(&username)?.split(',').collect();
|
||||
|
||||
for _ in 0..3 {
|
||||
if sess.authenticated() {
|
||||
break;
|
||||
}
|
||||
|
||||
// Re-query the auth methods on each loop as a successful method
|
||||
// may unlock a new method on a subsequent iteration (eg: password
|
||||
// auth may then unlock 2fac)
|
||||
let methods: HashSet<&str> = sess.auth_methods(&username)?.split(',').collect();
|
||||
log::trace!("ssh auth methods: {:?}", methods);
|
||||
|
||||
if !sess.authenticated() && methods.contains("publickey") {
|
||||
if let Err(err) = sess.userauth_agent(&username) {
|
||||
log::info!("while attempting agent auth: {}", err);
|
||||
|
Loading…
Reference in New Issue
Block a user