You can exchange files securely with Alloy using SSH and GPG keys. SSH keys are used to send files to Alloy and GPG keys are used to receive files from Alloy.
This article covers SSH Key Generation and GPG Key Generation on MacOS.
The article will cover the following sections:
- SSH Key Generation Guide:
- GPG Key Generation Guide:
- Troubleshooting
SSH Key Generation Guide
Generating the SSH Key
To generate an SSH key, the following steps will use the ssh-keygen
command-line utility. Follow the steps to generate a new public key:
- Open Terminal.
- Run the following command:
ssh-keygen -t rsa -b 4096
- You'll be prompted with the question "Enter a file in which to save the key." You can press "Enter" without inputting a file path to accept the default file location.
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/yourUserName/.ssh/id_rsa): - Next, you’ll be prompted to create a passphrase for your key. Enter your passphrase and hit "Enter".
Note: For security reasons, by default, Terminal will not display the characters you are typing. Even though no characters appear when you type your password, you are actually typing your password.Enter passphrase (empty for no passphrase):
- You will be prompted to re-enter your passphrase. Enter your passphrase and hit "Enter".
Enter same passphrase again:
- A fingerprint and random ASCII art image will be generated when the SSH key has been created.
Your identification has been saved in /Users/yourUserName/.ssh/id_rsa
Your public key has been saved in /Users/yourUserName/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:gS561lYwtrMlvt4ElSibyVM3/01/qsCB7dbbsxMdQjgI yourUserName@name-0196
The key's randomart image is:
+---[RSA 4096]----+
| oo |
+----[SHA256]-----+ -
Copy the public key to your clipboard using a method available to your operating system:
-
Command Line: Run the command
pbcopy < ~/.ssh/id_rsa.pub
in Terminal to copy the key from theid_rsa.pub
file to your clipboard. -
Text Editor: Using your text editor of choice, open the
~/.ssh/id_rsa.pub
file, and then copy the contents of the file to your clipboard.
-
Entering your SSH Key in Alloy
Continuing from step 7 in the previous section, you will need to have your copied public key.
To enter the SSH key that was generated into Alloy:
- Navigate to Settings, then Secure File Transfer.
- Select the tab Send file to Alloy.
- Select Provide SSH Public Key and enter your public key in the text field.
- Once you submit your SSH key, Alloy will automatically generate a GPG key for Alloy. You will also see a success message and your public keys displayed in plain text.
GPG Key Generation Guide
GPG Key Generation
To generate a GPG key, the following steps will use the gpg
command-line utility. Note that at each step there is an option to select a default. The default is fine, but we recommend choosing a setting that is right for you.
- Open Terminal.
- Run the following command:
gpg --full-generate-key
- When prompted, specify the kind of key you want, press "Enter" to accept the default.
If your organization requires using a different algorithm, please consult the GnuPG manual.Please select what kind of key you want:
(1) RSA and RSA
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
(9) ECC (sign and encrypt) *default*
(10) ECC (sign only)
(14) Existing key from card
Your selection? - If you selected the default in Step 3, you will be asked to enter which elliptic curve you want. Or press "Enter" to accept the default.
Please select which elliptic curve you want:
(1) Curve 25519 *default*
(4) NIST P-384
(6) Brainpool P-256 - Enter the length of time the key should be valid. Or press "Enter" to accept the default.
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) - Verify that your chosen expiration timeframe is correct.
Key expires at Tue Jul 4 12:44:53 2023 MDT
Is this correct? (y/N) - Construct a user ID by answering the prompted questions, then confirm your details are correct.
GnuPG needs to construct a user ID to identify your key.
Real name: Your Name
Email address: test@test.com
Comment: this is a comment placeholder
You selected this USER-ID:
"Your Name (this is a comment placeholder) <test@test.com>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? - Enter your passphrase. As you type, each character will appear as an asterisk. Hit "Enter" when entered.
- Re-enter your passphrase.
- A key is returned in a format that looks like this
pub ed25519 2023-07-03 [SC]
You can also run the command
123123123_THIS_IS_A_SAMPLE_KEYID_123123123
uid Your Name (this is a comment placeholder) <test@test.com>
sub cv25519 2023-07-03 [E]gpg --list-keys --keyid-format=long
to list all your existing GPG keys. - Use
gpg --armor --export <key>
where<key>
is replaced with the key ID. Copy the entire PGP PUBLIC KEY that is returned, including-----BEGIN PGP PUBLIC KEY BLOCK-----
to the end of-----END PGP PUBLIC KEY BLOCK-----
Entering Your GPG Key in Alloy
Continuing from step 12 in the previous section, you will need to have your copied GPG key.
To enter your GPG key that was generated into Alloy:
- Select Receive Files from Alloy under Secure File Transfer in Settings
- Select Provide GPG Public Key. Then enter your public key in the text field.
- Once you submit your GPG key, Alloy will automatically generate an SSH key. You will also see a success message and your public keys displayed in plain text.
Comments
0 comments
Article is closed for comments.