GitHub
https://github.com/tianheg.keys
1mkdir -m 700 ~/.ssh
2curl https://github.com/USERNAME.keys >> ~/.ssh/authorized_keys
3chown 600 ~/.ssh/authorized_keys
https://github.com/tianheg.gpg
GPG 公钥
1curl https://github.com/USERNAME.gpg >> ./gpg-pub.txt
2gpg --import ./gpg-pub.txt
To import a GPG public key and set permissions, you can follow these steps:
- Obtain the GPG public key file (.asc or .gpg file) from the person or source you want to import the key from.
- Open a terminal or command prompt on your computer.
- Navigate to the directory where the GPG public key file is located using the
cd
command. For example, if the file is in your Downloads folder, you can use the commandcd Downloads
to navigate to that directory. - Import the GPG public key by running the following command:
gpg --import <keyfile>
Replace <keyfile>
with the name of the GPG public key file you obtained. This command will import the key into your GPG keyring.
- Set the appropriate permissions for the imported key by running the following command:
gpg --edit-key <keyID>
Replace <keyID>
with the ID or email associated with the imported key. This command will open the GPG key editor.
- In the GPG key editor, enter the command
trust
to change the trust level of the key. - You will be prompted to select a trust level for the key. Choose the appropriate level based on your level of trust in the key owner.
- Save the changes and exit the GPG key editor.
Once you have imported the GPG public key and set the appropriate permissions, you can use it to verify signatures or encrypt messages with the corresponding private key.