{"record":{"id":"f2b17b2a82cd64d1","repo":"apache/seatunnel","slug":"ssh-host-host-authentication-failed-f2b17b","errorCode":null,"errorMessage":"ssh host \" + host + \"authentication failed","messagePattern":"ssh host \" \\+ host \\+ \"authentication failed","errorType":"exception","errorClass":"ClickhouseConnectorException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/file/ScpFileTransfer.java","lineNumber":81,"sourceCode":"\n    @Override\n    public void init() {\n        try {\n            sshClient = SshClient.setUpDefaultClient();\n            sshClient.start();\n            clientSession = sshClient.connect(user, host, SCP_PORT).verify().getSession();\n            if (password != null) {\n                clientSession.addPasswordIdentity(password);\n            }\n            if (keyPath != null) {\n                FileKeyPairProvider fileKeyPairProvider =\n                        new FileKeyPairProvider(Paths.get(keyPath));\n                KeyPair fileKeyPair =\n                        fileKeyPairProvider.loadKey(clientSession, KeyPairProvider.SSH_RSA);\n                clientSession.addPublicKeyIdentity(fileKeyPair);\n            }\n            if (!clientSession.auth().verify().isSuccess()) {\n                throw new ClickhouseConnectorException(\n                        ClickhouseConnectorErrorCode.SSH_OPERATION_FAILED,\n                        \"ssh host \" + host + \"authentication failed\");\n            }\n            scpClient = ScpClientCreator.instance().createScpClient(clientSession);\n        } catch (IOException | GeneralSecurityException e) {\n            throw new ClickhouseConnectorException(\n                    ClickhouseConnectorErrorCode.SSH_OPERATION_FAILED,\n                    \"Failed to connect to host: \" + host + \" by user: \" + user + \" on port 22\",\n                    e);\n        }\n    }\n\n    @Override\n    public void transferAndChown(String sourcePath, String targetPath) {\n        try {\n            scpClient.upload(\n                    sourcePath,\n                    targetPath,","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/file/ScpFileTransfer.java#L63-L99","documentation":"ScpFileTransfer.init() throws this when the SSH authentication result against the remote host is not successful. Credentials (password or key-based with SSH_RSA) were rejected by the SSH server. No file transfer can begin.","triggerScenarios":"init() calls clientSession.auth().verify() and isSuccess() is false — wrong password, rejected/wrong key file, or the server disallows the auth method tried (e.g. only keyboard-interactive allowed, or server disabled ssh-rsa).","commonSituations":"Wrong username/password in config, key at `keyPath` is not the key authorized on the host, key is in a newer OpenSSH format while the server/SSH-RSA negotiation fails (OpenSSH 8.8+ disabling ssh-rsa SHA-1), or server-side restrictions (AllowUsers, PermitRootLogin no).","solutions":["Verify username/password (or keyPath) in the ClickHouse sink config are correct","Test the same credentials manually: ssh user@host — confirm they succeed","If using key auth, confirm the key is authorized in the host's ~/.ssh/authorized_keys and readable by the SeaTunnel process","If the server rejects ssh-rsa (OpenSSH 8.8+), enable rsa-sha2 or use an ed25519 key supported by your sshd-client version","Check the server's sshd_config / auth log for why the auth method was refused"],"exampleFix":"// before\npassword = \"wrong-pass\"\n// after: correct credential or authorized key path\nusername = \"deploy\"\npassword = \"<correct-password>\"\n# or\nkey.path = \"/home/user/.ssh/id_rsa\"","handlingStrategy":"validation","validationCode":"# validate credentials before running the job\nssh -o BatchMode=yes -i \"$KEY_PATH\" \"$USER@$HOST\" true && echo auth-ok\n# or with password: sshpass -p \"$PASSWORD\" ssh -o StrictHostKeyChecking=no \"$USER@$HOST\" true","typeGuard":null,"tryCatchPattern":"try {\n    transfer.init();\n} catch (ClickhouseConnectorException e) {\n    if (String.valueOf(e.getMessage()).contains(\"authentication failed\")) {\n        throw new RuntimeException(\"Check sink SSH username/password/keyPath config\", e);\n    }\n    throw e;\n}","preventionTips":["Test SSH credentials manually with the exact user/key before configuring the sink","Confirm the key is in the server's authorized_keys and readable by the SeaTunnel process","For OpenSSH 8.8+ servers, avoid deprecated ssh-rsa SHA-1; use ed25519 or rsa-sha2","Check sshd_config restrictions (AllowUsers, PasswordAuthentication, PubkeyAuthentication)"],"tags":["ssh","authentication","scp","clickhouse"],"backgroundTag":"authentication-required","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}