Quantcast
Channel: A Portal to a Portal
Viewing all articles
Browse latest Browse all 1850

SSH keys and variables

$
0
0

Leaving this here to remind my future self ...

I wanted to generate a variable containing my SSH public key ..

I tried to simply copy the key to my clipboard and paste it into the variable: -

export MY_PUB_KEY="ssh-rsa ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE foo@bar.com"

which is somewhat unwieldy.

However, given that my public key is in a file: -

id_rsa_04012022.pub

why didn't I simply do this ?

export MY_PUB_KEY=$(cat ~/.ssh/id_rsa_04012022.pub)

Now isn't that simpler ?


Viewing all articles
Browse latest Browse all 1850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>