I'm trying to append a certificate to a remote server's certificates file, using the folliwing command
openssl s_client -connect host:port | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | minikube ssh 'sudo su - && cat >> /etc/ssl/certs/ca-certificates.crt'
However, it seems that the remote host tries to evaluate the lines of text, rather than appending them to the remote file, leading to the following error mesages:
-sh: line 1: -----BEGIN: command not found -sh: line 2: MIIGETCCA/mgAwIBAgIQBNtwjkSfT+QGafgAnqb9JDANBgkqhkiG9w0BAQsFADBK: No such file or directory -sh: line 3: MQswCQYDVQQGEwJOTDEdMBsGA1UEChMUS29uaW5rbGlqa2UgS1BOIE4uVi4xHDAa: command not found -sh: line 4: BgNVBAMTE0tQTiBOLlYuIFByaXZhdGUgQ0EwHhcNMTYwNzI4MDAwMDAwWhcNMTkw: command not found -sh: line 5: NzI4MjM1OTU5WjCBhDELMAkGA1UEBhMCTkwxFTATBgNVBAgMDFp1aWQgSG9sbGFu: command not found . . . -sh: line 35: -----END: command not found
How can I prevent the lines from being evaluated and just have them added to the remote file? Thanks!