`
wellee
  • 浏览: 101025 次
  • 性别: Icon_minigender_1
  • 来自: 温州
社区版块
存档分类
最新评论

How To Convert Your Putty .ppk Private Key To A Normal SSH Key You Can Use On An

阅读更多

http://leadingedgescripts.co.uk/server-administration/how-to-convert-your-putty-ppk-private-key-to-a-normal-ssh-key-you-can-use-on-an-apple-mac/

 

 

Also, how to connect to a server using SSH on a Mac

I already knew that I could open an SSH connection on my Mac using Terminal, and I could SSH onto my production server from my XP pc using Putty with no problems.

So when I copied my .ppk Putty key from my PC to my Mac I expected to be able to type:

 

ssh -2 username@123.123.123.123 –i yourkey.ppk

 

from within Terminal and get straight onto my server with no questions asked.

But oh no! it’s not quite as easy as that – well these things never are, are they?

Let start with the very basics, you can find the Terminal program on your Macintosh in Applications -> Utilities.

Open it and you have something resembling a Windows DOS prompt.

Now if you already have a .ppk file from your PC that you want to convert to use on your Mac you need to visit the Putty Website www.chiark.greenend.org.uk/~sgtatham/putty/download.html and download puttygen.exe (on your PC) now open it, and using the File menu, load your .ppk that you already use, and type in your pass phrase.

 

Now go to the Conversions menu and export the key as an OpenSSH key – hey presto – you now have a key file that will work on your Mac! Such a simple solution, yet that took me so long to figure out …

Anyway, now you just need to copy your new .ssh keyfile over to your home (~) directory on your Mac and set the permissions to 700 (chmod 700 yourkey.ssh).

Once you’ve done all that you can use the ssh command.

 

				
ssh -2 username@123.123.123.123 –i yourkey.ssh
				

 

and you should be able to SSH onto your box as you would from your PC – amazing!

http://magp.ie/2010/01/31/use-a-putty-generated-key-on-mac-osx/


Use a PuTTY generated key on Mac OSX

I wanted to use the key I generated using the PuTTYGen tool on my windows laptop, on my now repaired Mac Pro. The standard PuTTY generated key will not work on Linux or Mac OSX, so the key needs to be converted into a standard that will, like OpenSSH. You can convert your key by using the ‘Export to OpenSSH’ option explained in a previous post.


Once you have your new private OpenSSH key, copy it to your Mac.

Open terminal, and go to your root… usually does this automatically, but type cd ~/ just in case.

Create a .ssh directory if it does not already exist and copy the private key in here.

You may need to check that the key has the right permissions, type chmod -R g0-rx ~/.ssh

Enter your ssh command, ssh username@serverhostname.com and hit enter, you should get now have a SSH tunnel to your server.


HANDY TIP: use the vvv flag to debug the ssh command  (looks odd but thats 3 v’s by the way!).

So type ssh username@serverhostname.com -vvv to receive a load of debug info that can be really useful in determining where you are screwing up.

Also I found this guide useful.

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics