diff --git a/config/src/ssh.rs b/config/src/ssh.rs index 162696884..bacb65e43 100644 --- a/config/src/ssh.rs +++ b/config/src/ssh.rs @@ -42,6 +42,10 @@ pub struct SshDomain { pub remote_wezterm_path: Option, pub ssh_backend: Option, + + /// ssh_config option values + #[serde(default)] + pub ssh_option: HashMap, } impl_lua_conversion!(SshDomain); diff --git a/docs/changelog.md b/docs/changelog.md index 89335c2a3..4111a719e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -15,6 +15,7 @@ As features stabilize some brief notes about them will accumulate here. * unix domains now support an optional `proxy_command` to use in place of a direct unix socket connection. [Read more about multiplexing unix domains](multiplexing.html#unix-domains) * [ScrollToTop](config/lua/keyassignment/ScrollToTop.md) and [ScrollToBottom](config/lua/keyassignment/ScrollToBottom.md) key assignments [#1360](https://github.com/wez/wezterm/issues/1360) +* [SSH Domains](config/lua/SshDomain.md) now support specifying `ssh_config` overrides. [#1149](https://github.com/wez/wezterm/issues/1149) #### Changed diff --git a/docs/config/lua/SshDomain.md b/docs/config/lua/SshDomain.md index 7dbe7b209..ba701d329 100644 --- a/docs/config/lua/SshDomain.md +++ b/docs/config/lua/SshDomain.md @@ -35,3 +35,22 @@ It is a lua object with the following fields: -- remote_wezterm_path = "/home/yourusername/bin/wezterm" } ``` + +*Since: nightly builds only* + +You may now specify a table with ssh config overrides: + +```lua +return { + ssh_domains = { + { + name = "my.server", + remote_address = "192.168.1.1", + ssh_option = { + identityfile = "/path/to/id_rsa.pub", + } + } + } +} +``` + diff --git a/wezterm-client/src/client.rs b/wezterm-client/src/client.rs index 90d19ccb1..ad81fc876 100644 --- a/wezterm-client/src/client.rs +++ b/wezterm-client/src/client.rs @@ -518,6 +518,9 @@ impl Reconnectable { } .to_string(), ); + for (k, v) in &ssh_dom.ssh_option { + ssh_config.insert(k.to_string(), v.to_string()); + } if let Some(username) = &ssh_dom.username { ssh_config.insert("user".to_string(), username.to_string());