Browse Source

add ssh key for encrypt secrets

master
Markus Bergholz 3 years ago
parent
commit
c8fc61ad38
  1. 22
      til.md

22
til.md

@ -411,3 +411,25 @@ cat /var/log/messages
...
Oct 9 09:37:29 localhost /netbsd: hello kernel!
```
# ssh
create pub key from private
ssh-keygen -y -f my.key > my.pub
create pem from public
ssh-keygen -f ~/.ssh/my.pub -e -m PKCS8 > my.pem
encrypt message with pem
echo "some secret" |openssl rsautl -encrypt -pubin -inkey my.pem -ssl
echo "some secret" |openssl rsautl -encrypt -pubin -inkey my.pem -ssl > encrypted_message
echo "some secret" |openssl rsautl -encrypt -pubin -inkey my.pem -ssl -out encrypted_message
decrypt message with private
openssl rsautl -decrypt -inkey ~/.ssh/my.key -in encrypted_message
Loading…
Cancel
Save