Welcome to the Linux Foundation Forum!

Lab 3.2 - step 4 - not getting any output (hash)

adeelmirza
adeelmirza Posts: 2
edited August 2018 in LFS258 Class Forum

ubuntu@ip-172-31-7-165:~$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.*//'

ubuntu@ip-172-31-7-165:~$



--

No error just see a blank space where the CA Cert Hash should be.

Any ideas?

Adeel

Comments

  • chrispokorni
    chrispokorni Posts: 2,605

    Hi Adeel, 

    I see 2 possible issues here: 

    1 - In the lab, there is a blank space between * and //


    sed 's/^.* //'

    If it disappeared during copy/paste that could be one of your issues. 

    2 - Curly single quotes around the 


    's/^.* //'

    from the lab PDF. They tend to cause errors or things not to happen as expected. You may encounter them in a few different places throughout the labs. The simple workaround is to copy the command in a simple text editor, delete the curly single quotes and type the apostrophe sign instead. Then copy the command from here and paste into the terminal. It seems that different text formats are treating these characters differently even if they look ok. 

    Or, if pasting directly into the terminal, delete the curly single quote and type apostrophe instead.

    I only encountered this problem with the curly single quotes from the PDF. 

    Good luck!

    -Chris

  • adeelmirza
    adeelmirza Posts: 2
    edited August 2018

    Thanks for the help...yes, it was a spacing issue in the sed command...

     

    ubuntu@ip-172-31-7-165:~$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'

    e1224288d0313462c554a8f86d63cbc8797bc87d1e9d6dd6136577178787be46

     

Categories

Upcoming Training