Skip to content

Commit

Permalink
ssh default port to 22 if not provided - don't show error
Browse files Browse the repository at this point in the history
  • Loading branch information
flawiddsouza committed Nov 10, 2024
1 parent 03bec98 commit 25d9196
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
if let Some(target_host) = server_config.hosts.get(host) {
let is_localhost = target_host.host == "localhost";
let session = if !is_localhost {
let port = target_host.port.ok_or("Missing port for remote host")?;
let port = target_host.port.unwrap_or(22); // Use default port 22 if not provided
let user = target_host
.user
.as_deref()
Expand Down

0 comments on commit 25d9196

Please sign in to comment.