MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / render_ssh_config

Function render_ssh_config

crates/openshell-cli/src/ssh.rs:1435–1448  ·  view source on GitHub ↗
(gateway: &str, name: &str)

Source from the content-addressed store, hash-verified

1433}
1434
1435fn render_ssh_config(gateway: &str, name: &str) -> String {
1436 let exe = std::env::current_exe().expect("failed to resolve OpenShell executable");
1437 let exe = shell_escape(&exe.to_string_lossy());
1438
1439 let proxy_cmd = format!(
1440 "{exe} ssh-proxy --gateway-name {} --name {}",
1441 shell_escape(gateway),
1442 shell_escape(name),
1443 );
1444 let host_alias = host_alias(name);
1445 format!(
1446 "Host {host_alias}\n User sandbox\n StrictHostKeyChecking no\n UserKnownHostsFile /dev/null\n GlobalKnownHostsFile /dev/null\n LogLevel ERROR\n ServerAliveInterval 15\n ServerAliveCountMax 3\n ProxyCommand {proxy_cmd}\n"
1447 )
1448}
1449
1450fn openshell_ssh_config_path() -> Result<PathBuf> {
1451 Ok(openshell_core::paths::xdg_config_dir()?

Callers 1

install_ssh_configFunction · 0.85

Calls 2

host_aliasFunction · 0.85
shell_escapeFunction · 0.50

Tested by

no test coverage detected