feat(ssh): probe none authentication before credentials
Some SSH proxies and jump-hosts authenticate with the "none" method, requiring no password or key. dbx only tried publickey/password/agent, so connecting through such a host failed with "SSH public key authentication failed" — and the frontend forced users to enter a credential just to pass validation. - Backend: probe authenticate_none first in connect_and_authenticate; on rejection fall back to the configured credential method, matching standard openssh behavior. - Frontend: drop the "password/key/agent required" check in validateTransportLayers so passwordless hops can be saved and tested. Refs #1628
This commit is contained in:
1 parent
4b45912862
commit
849caf4b39
2 files changed
+19
-4
No files matched your search
@@ -2139,9 +2139,9 @@ function validateTransportLayers(config: LegacyConnectionConfig) {
|
||||
}
|
||||
if (layer.type === "ssh") {
|
||||
if (!layer.user?.trim()) throw new Error(t("connection.sshHopInvalidUser", { hop: label }));
|
||||
if (!layer.password?.trim() && !layer.key_path?.trim() && !layer.use_ssh_agent) {
|
||||
throw new Error(t("connection.sshHopInvalidAuth", { hop: label }));
|
||||
}
|
||||
// Auth credentials are optional: the backend probes "none" authentication
|
||||
// first, so hops that require no credential (e.g. passwordless SSH proxies)
|
||||
// are valid with password, key, and agent all left empty.
|
||||
const timeout = Number(layer.connect_timeout_secs);
|
||||
if (!Number.isFinite(timeout) || timeout < 1 || timeout > 300) {
|
||||
throw new Error(t("connection.sshHopInvalidTimeout", { hop: label }));
|
||||
|
||||
Reference in new issue
Block a user