LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-10-2006, 10:18 AM   #1
mikewgilligan
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Rep: Reputation: 0
ssh public key authentication setup


I'm setting up rsa public key authentication between a Windows client using the putty ssh client and a remote Linux server. I have already created the key pair using ssh-keygen on the Linux server and added the public key to .ssh/authorized_keys
I need to import the private key into the putty client but my problem is getting the id_rsa file from the Linux server to the Windows client. I have tried to cut and paste to a text file on the Windows machine but putty doesn't like it. I have also tried to scp username@windows_machine but could not get it to work.
Anyone have a quick and dirty way to get the private key transfered?
Thanks.
 
Old 07-10-2006, 10:31 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
cut and paste over puTTY works just fine. what is actually going wrong?
 
Old 07-10-2006, 09:49 PM   #3
mikewgilligan
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
According to putty documentation:
"If you use ssh-keygen you have to import and save the private with Puttygen because Putty has its own storage format".
When I choose Import Key from Puttygen it asks me for a file name. I did create a text file called id_rsa on my Windows client and cut and paste the private key from ssh-keygen and tried to import to Puttygen but it tells me "Couldn't load private key".
Thanks.
 
Old 07-10-2006, 10:01 PM   #4
mattLSO
Member
 
Registered: Jun 2005
Posts: 43

Rep: Reputation: 15
Hey just to check, did you goto the converstion menu and import key rather than trying to just load the key?

Also you can use winscp to connect to the windows system to transfer it in its original form.

http://winscp.net/eng/index.php

Once you have the .ppk then load the .ppk file into pagent and you are ready to go.

Regards
 
Old 07-10-2006, 11:24 PM   #5
mikewgilligan
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Hi Matt
Yes correct I'm choosing Import Key from the Conversions menu in Putty. thanks for the link to WinSCP. I did come across it during my research but wasn't sure if it was what I needed. So could I confirm with you that by downloading and installing WinSCP on my Windows client I will be able to scp the private key from my Linux box ? Also the private key generated doesn't have the .ppk extension. I generated the key pair from the Linux server rather than through putty.
Thanks.
 
Old 07-11-2006, 02:45 AM   #6
mikewgilligan
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Update: Just downloaded and installed WinSCP and grabbed the private key without issue and was able to successfully import to putty. Thanks for the help.
 
Old 07-11-2006, 06:34 AM   #7
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
Quote:
Originally Posted by mikewgilligan
I'm setting up rsa public key authentication between a Windows client using the putty ssh client and a remote Linux server.
RSA should be authorized_keys2.

btw I use puttygen to generate the RSA public key which i then copy the key text and paste to the linux users home directory in:
/home/user/.ssh/authorized_keys2

chown user:user -R .ssh/

and then i load the private key generated by puttygen in Putty's pageant..open putty client ..enter user ,IP : port of linux server and done...simple

Even Winscp can atomatically read the private key from pageant

Quote:
Originally Posted by mikewgilligan
I have also tried to scp username@windows_machine but could not get it to work.
Anyone have a quick and dirty way to get the private key transfered?
Thanks.
this is excellent SSH server for Windows

http://freesshd.com/

Last edited by ~=gr3p=~; 07-11-2006 at 06:38 AM.
 
Old 07-12-2006, 09:54 PM   #8
mikewgilligan
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
gr3p
The newer versions of OpenSSH no longer uses the ~/.ssh/authorized_keys2 file. All public keys should simply by put into the ~/.ssh/authorized_keys file for both SSH protocols 1 and 2 for public key authentication.

cat ~/.ssh/authorized_keys2 >>~/.ssh/authorized_keys
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh public key authentication teacup Linux - Networking 4 11-28-2011 12:27 AM
DISCUSSION: Public key authentication with ssh david_ross LinuxAnswers Discussion 31 02-02-2011 09:13 AM
ssh public key authentication problem flgal3 Linux - Software 21 02-06-2009 12:15 PM
Can't use public key authentication with SSH Noob69 Linux - General 5 01-06-2006 07:27 AM
SSH - Problem with Public Key Authentication HaPagan Linux - Security 5 11-29-2005 12:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration