Issue #2243: suppress prompt to save a yet unknown host key in ssh mode, by disabling StrictHostKeyChecking

This commit is contained in:
Ansgar Becker
2025-10-06 16:48:07 +02:00
parent d815ed9c5a
commit bb1298c4b2

View File

@@ -1106,6 +1106,8 @@ begin
SshCmd := SshCmd + IfThen(IsPlink, ' -P ', ' -p ') + IntToStr(FConnection.Parameters.SSHPort);
if FConnection.Parameters.SSHPrivateKey <> '' then
SshCmd := SshCmd + ' -i "' + FConnection.Parameters.SSHPrivateKey + '"';
if not IsPlink then
SshCmd := SshCmd + ' -o StrictHostKeyChecking=no';
SshCmd := SshCmd + ' -N -L ' + IntToStr(FConnection.Parameters.SSHLocalPort) + ':' + FConnection.Parameters.Hostname + ':' + IntToStr(FConnection.Parameters.Port);
rx := TRegExpr.Create;
rx.Expression := '(-pw\s+")[^"]*(")';