The ~/id_rsa.pub path tells the command to extract id_rsa.pub to your home directory.Īnd for those out there who see what I did above and what I am doing below, yes the command could probably be something like this to dump the public key right into authorized_keys: openssl rsa -in id.pem -pubout > ~/.ssh/authorized_keysīut this answer is about tracing the details, understanding the process and seeing where things “broke.” So cleanly dumping a public key into ~/.ssh/authorized_keys directly is faster but not necessarily better for learning purposes. Of course, change the name/path of id.pem to match the path of where that file is located on the system. It’s easy enough by doing something like this on the Mac OS X system from the Terminal: openssl rsa -in id.pem -pubout > ~/id_rsa.pub pem directly, but for my preferred method of creating password-less setups, I would recommend you extract the public key before proceeding any further. pem file ( id.pem) which is just a container format that encompasses the public and private key in a certificate. Preface.īased on your comments and recent edit you seem to have a. ![]() Here are the steps you should use if you already have a public key file ( ~/.ssh/id_rsa.pub) located on your remote server. This is what you need to do to add the public key to the Mac OS X authorized_keys file for your user. On Windows you clearly added the public key correctly. This is a good start for a password-less setup. Server is my public key and I have private key that was created I’m trying to use SSH client for logging on remote server. I also tried using ssh parameter -i to specify the key manually, but with same results.Ĭommand used to create PEM format was 'puttygen id.ppk -O private-openssh -o id.pem' Log output (only relevant part) debug1: Authentications that can continue: publickey,passwordĭebug1: Trying private key: /Users/josef/.ssh/talnet_rsaĭebug1: read PEM private key done: type RSAĭebug3: sign_and_send_pubkey: RSA #I removed these for security reasons#ĭebug2: we sent a publickey packet, wait for replyĭebug1: Authentications that can continue: publickey,passwordĭebug2: we did not send a packet, disable methodĭebug1: Next authentication method: password My SSH config contains path to private key for the host I'm trying to connect. I found that similar problems may happen when private key is in PPK format (which was my case), so I tried to convert it to PEM, but it didn’t help: puttygen id.ppk -O private-openssh -o id.pem Here also doesn’t matter what I enter, it’s always writes permission denied. On Mac OS X when I use SSH client, Window asking for password pops-up and whatever I enter, SSH asks me for password. On Windows I’m able to login via PuTTY without problems. On this server is my public key and I have private key that was created without passphrase.
0 Comments
Leave a Reply. |