Welcome to the Linux Foundation Forum!

Lab 3.2 Grow the Cluster

Options

Exercise point No.5 - Create and use a Discovery Token CA Cert Hash
While running the below command on cp getting an error, I have tried to remove all the unwanted characters caret (ˆ) and the single quote (’).

openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed's/^.* //'

Error
root@instance-group-lsd-1q28:~# openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform
der 2>/dev/null | openssl dgst -sha256 -hex | sed's/ˆ.* //'
-bash: seds/ˆ.* //: No such file or directory

Comments

  • chrispokorni
    chrispokorni Posts: 2,178
    Options

    Hi @ganjuv,

    Both the caret and the single quote are required by the openssl command. In some environments, however, the caret and the single quotes, as pasted from the pdf, may be misinterpreted by the terminal. In such cases they need to be deleted and typed in manually for the command the work as expected.

    Regards,
    -Chris

  • ganjuv
    ganjuv Posts: 3
    Options

    I think the issue is with space between seds ==> sed s

  • ganjuv
    ganjuv Posts: 3
    Options

    @chrispokorni said:
    Hi @ganjuv,

    Both the caret and the single quote are required by the openssl command. In some environments, however, the caret and the single quotes, as pasted from the pdf, may be misinterpreted by the terminal. In such cases they need to be deleted and typed in manually for the command the work as expected.

    Regards,
    -Chris

    Thanks @chrispokorni

Categories

Upcoming Training