From 13fa58336838a6a2f5467d12c9bd2bbb46db0049 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 23 Jul 2024 10:07:44 +0100 Subject: [PATCH] sftp: clarify the docs for key_pem - fixes #7921 --- backend/sftp/sftp.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go index 4fd88ab48..21309afa3 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -75,8 +75,18 @@ func init() { Help: "SSH password, leave blank to use ssh-agent.", IsPassword: true, }, { - Name: "key_pem", - Help: "Raw PEM-encoded private key.\n\nIf specified, will override key_file parameter.", + Name: "key_pem", + Help: `Raw PEM-encoded private key. + +Note that this should be on a single line with line endings replaced with '\n', eg + + key_pem = -----BEGIN RSA PRIVATE KEY-----\nMaMbaIXtE\n0gAMbMbaSsd\nMbaass\n-----END RSA PRIVATE KEY----- + +This will generate the single line correctly: + + awk '{printf "%s\\n", $0}' < ~/.ssh/id_rsa + +If specified, it will override the key_file parameter.`, Sensitive: true, }, { Name: "key_file",