Note that if you need to copy both your Private and Public key, you’ll need to export both separately.
You can list all the GPG keys with the following command.
Change “keyID” to your key idea from the above command. The key ID is the long string of hexadecimal characters.
gpg --export-secret-keys "keyID" > private_key.asc
This will export the keys to private_key.asc. Rename as appropriate.
To export the Public Key
gpg --export "keyID" > public_key.asc
To use the key, you’ll need to import and trust the key.
gpg --allow-secret-key-import --import private_key.asc
gpg --edit-key "keyID"
Select level 5.
Import the Public Key
gpg --import public_key.asc
For some reason I ran into an issue where I can not remove authorized SSH Keys in AirOS version 6.3. It redirects to a 404 page and then to the main page.
Thankfully, we can still remove the authorized keys from the command line. For more information on making changes over SSH, refer to the following post.
SSH into radio. Replace username and IP address with your radios user and IP.
Open up config file
Search for the lines that contain
the sshd.auth.key and remove them
Save the file and write the configuration with
Once the command completes, you should be good to go.
All that needs to be done is the “id_rsa” key needs to be copied to the “new” host. You can do this with SCP or sftp.
Example with SCP
The following examples are showing how to export a RSA private key, if your using DSA, then replace id_rsa with id_dsa.
Copy private key from remote server to local machine for the local user
scp email@example.com:~/.ssh/id_rsa ~/.ssh/
Copy private key from localhost to remote host. This command copies the local users private key to the root user @ 192.168.1.1
scp ~/.ssh/id_rsa firstname.lastname@example.org:~/.ssh/