Skip to content

Commit 6b92110

Browse files
committed
feat: set preferred algo order
we love ed25519
1 parent 9adc469 commit 6b92110

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sshconfig.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ func sshConfig(server *Server, keyAuth ssh.AuthMethod, knownHostsFilePath *strin
2121
User: *server.Username,
2222
Auth: authMethods,
2323
Timeout: DefaultTimeout,
24+
HostKeyAlgorithms: []string{
25+
// Most secure one
26+
ssh.KeyAlgoED25519,
27+
28+
// Relatively secure ones
29+
ssh.KeyAlgoECDSA521,
30+
ssh.KeyAlgoECDSA384,
31+
ssh.KeyAlgoECDSA256,
32+
33+
// Keep for backward compatibility
34+
ssh.KeyAlgoRSA,
35+
},
2436
}
2537

2638
if knownHostsFilePath != nil {

0 commit comments

Comments
 (0)