Synology NAS devices can both connect to a Virtual Private Network (VPN) tunnel (via the VPN client) or host VPN connections (via the VPN server). Even though setting up the VPN server is undoubtedly useful, we're going to be focusing on the VPN client. The client is what's needed to connect to one. The private key must not have any spaces, remove them if they existt in your backup. The label may have spaces, the quotes are only needed if you want a space in the label. You now have to be patient.
Active4 years, 9 months ago
I created a couple of self-signed S/MIME certificates (using OSX Keychain & OpenSSL) and then exported these into 3 files:
When attempting to import these back into another Mac, the Certificate and Private Key imported without any issues. But the Public Key can't be imported.
Instead I get the following error message:
An error has occurred. Unable to import an item.
The contents of this time cannot be retrieved
How can I import the public key? Should it be converted to another format for import?
PremboPrembo
3 Answers
Its a bug in OSX. You can import from the command line as per this answer:
The command is:
You'll then need to rename the key in keychain.app
Community♦
ChrisChris
1,12411 gold badge1313 silver badges2121 bronze badges
The certificate actually contains a copy of the public key (along with a name, and a signature from the certificate authority saying that name and that public key go together). Normally you don't need to deal with the public key as a separate item if you're using a certificate-based system like SMIME. If you wanted to, you could extract a copy of the public key from the certificate using the openssl
x509 command.
(I wonder if Keychain is refusing to import the public key because it thinks it already has a copy, in the certificate? Keychain's error messages are usually pretty vague.)
Wim LewisWim Lewis
A .p12 file can hold your key pair. You'll be prompted for a password if it contains your private key. Keychain will show the private key in a nested way. If imported correctly it should show under 'My Certificates'.
bbaassssiieebbaassssiiee
1,03311 gold badge1010 silver badges1515 bronze badges
Not the answer you're looking for? Browse other questions tagged macosopensslpublic-keykeychainprivate-key or ask your own question.
Activeyesterday
I set up my Linux server to accept connections from my home PC by adding the public key generated by PuTTYgen to the
authorized_keys file.
Now I'm trying to connect to the same machine, but this time from another Ubuntu machine. I have to use the same private key (for a weird reason, don't ask..) and I don't quite get how to install it on my client Ubuntu.
Do I have to convert it to some other format?
Assaf LavieAssaf Lavie
91333 gold badges1111 silver badges1313 bronze badges
8 Answers
I am not sure if your private key will work in ubuntu, but its worth a shot. just copy the keys to
/home/yourName/.ssh/ name the private key as id_rsa , and the public key as id_rsa.pub .
If that is not working, then you can create you own ssh key-pair using
ssh-keygen and copy the new public key to the server, and ssh as follows
I haven't played with it, but I hear that ssh-agent can also be used to manage ssh-keys.
Oli♦
230k9494 gold badges587587 silver badges780780 bronze badges
theTuxRacertheTuxRacer
7,7551616 gold badges6262 silver badges8888 bronze badges
By coincidence, I just had to do this. You do need to convert the keys to OpenSSH format. The command for doing that is:
then you can copy the contents of
openssh_key in to .ssh/authorized_keys just as with a normal SSH key.
The
-i option is the one that tells ssh-keygen to do the conversion. The -f option tells it where to find the key to convert.
This works for unencrypted keys. The public key is unencrypted, but the private one is probably encrypted. I'm not sure if it there's a way to unencrypt the private key, convert it, and then recrypt it. It may well be easier to use new keys as the other answer suggests (and I'd recommend using
ssh-agent though that's orthogonal to the current issue).
Loop SpaceLoop Space
Andrew Stacey explained how to convert the keys to OpenSSH format on Linux.
If you want to do the same on Windows, follow these steps:
Community♦
hheimbuergerhheimbuerger
47011 gold badge55 silver badges1010 bronze badges
How to re-use your Putty key pairs in Ubuntu as OpenSSH keys:
Do I Need To Import A Private Syology Key For My Mac Client Management
Since purpose of step 4 is to add your public key to *~./ssh/authorized_keys*, so you can use your Putty secret key like this instead of doing 4 as an intermediate step:
Octavian Damiean
Do I Need To Import A Private Syology Key For My Mac Client Certificate
11.9k77 gold badges4949 silver badges6161 bronze badges
user18617user18617
PuTTY/PuTTYgen uses its own proprietary format of key pair. It won't work on Linux, where OpenSSH format of keys prevails.
See the official Using PuTTYgen, the PuTTY key generator.
You can also use a Linux version of PuTTYgen to do the conversion. Linux version is command-line, contrary to Windows version.
See Linux
puttygen man page.
Martin PrikrylMartin Prikryl
I found one more clear solution.
On
puttygen create a key, then navigate to Top menu - Conversion and click export openssh key
File content will start and end with
Note :
53.1k1414 gold badges149149 silver badges250250 bronze badges
P-KumarP-Kumar
** Be careful and make sure you have console access to the box because if you don't do it right, you won't be able to ssh in again until you fix it from the console.
The process is much easier than you think. Load the public / private key pair you generated in puttygen again. In puttygen, you'll notice a window in the middle of the screen which says: 'Public key for pasting into Open SSH authorized_keys file:'.
highlight the entire contents of the box and press control-c to copy it.
SSH into your linux box and paste it into the '/home/username/.ssh/authorized_keys' file. I prefer to use nano and just right click to paste it in. Make sure it all stays on one line.
Modify your /etc/sshd_config file as needed and restart your sshd service: 'service ssh restart'
If you need a sample sshd_config file, let me know and I can post mine.
I've done this on Ubuntu 8.04, 10.04 and 12.04 LTS server and it works slick.
ErnestAErnestA
I am not sure if this thread is still active, but I stumbled upon a similar problem with Windows 10 anniversary edition which now support Ubuntu kernel. I use to use Putty before for connecting to Linux machine. For generating id_rsa in linux format, use puttykeygen and load your putty private key then click on conversion and choose the second option.
open the newly generated key file and copy all it's contents, make sure your content starts with : -----BEGIN RSA PRIVATE KEY----- and ends with -----END RSA PRIVATE KEY-----
vi id_rsa inside your ~/.ssh directory and paste the copied contents, this is required because linux otherwise will not understand the contents of the file.
That's all, try ssh to the remote server, it should work.
binishbinish
Not the answer you're looking for? Browse other questions tagged sshopensshputty or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |