The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ssh public/private Keys richo king UNIX for Dummies Questions & Answers 2 03-13-2008 03:34 PM
Migration from OLD server to NEW one aldowsary AIX 11 11-10-2006 08:11 PM
ssh public keys ghost01 UNIX for Dummies Questions & Answers 1 06-30-2006 10:59 AM
SSH public and private keys new2ss UNIX for Advanced & Expert Users 2 02-13-2006 08:06 PM
converting F-Secure public keys dangral SUN Solaris 0 12-08-2005 01:29 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-30-2008
Registered User
 

Join Date: Jul 2008
Posts: 1
How do I set the public keys up correctly for a migration from an HP-UNIX server to I

I am getting the error message
"Permission denied (publickey).
lost connection"
when I attempt to do an scp migration. I know how to generate the public keys in both IIS and UNIX, and I believe they are both suppose to have the same public key - but where are they each suppose to be stored (I believe it might be the home directory which I suppose is home/user/.ssh in UNIX but where in IIS?)

In addition, what format should the key be in? (I am not sure if I need to use some "$ ssh-keygen -e -f yourkey.pub > yourkey_ssh2.pub" command to convert the public key to secsh public key file format on the client or just leave it as a long alphanumeric string)? Do the public keys in each server need to be the same format?

Also, Ive read about setting up an "authorized_keys" file and/or an authorization file - but I dont know exactly what these files should contain and where they should be located.
Reply With Quote
Forum Sponsor
  #2  
Old 07-30-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 734
Post

For some background on public/provate key pairs:
Public-key cryptography - Wikipedia, the free encyclopedia

Each ssh server (ie sshd) should have it's own unique host key pairs (ie, nothing to do with the user or your home dir). These verify that the server you are connecting to is who it says it is (via your known_hosts file) and handles the actual data encryption.

Then, each user of ssh can generate a key pair (or many if they wish) if they want to identify themselves via these keys. Whatever you do, don't overwrite one user's generated keys with another just to get a login to work.
To enable passwordless authentication via keys, copy the public key of the source into the authorized_keys file of the destination.

Example:
USER1 on HOSTA wants to be able to log in as USER2 on HOSTB.
  1. Log into HOSTA as USER1
  2. Generate a key pair for USER1
  3. Take a copy of the _public_ key from the pair you just made
  4. Log in to HOSTB as USER2
  5. Create (or edit) the authorized_keys file (this filename is defined in the sshd configuration on HOSTB)
  6. Add your public key for USER1 from HOSTA to the authorized_keys file belonging to USER2 on HOSTB
  7. Most key generators create a short comment at the end of the public key, make sure this also gets added to your authorized_keys file (ie just add the whole block) as this makes it easier to manage things if you get a lot of keys. You can make something up in this field if you want to help you track them
  8. OPTIONAL: Prepend the key in your authorized_keys file with from="<ip address>" if you want to increase the security by also validating the user by the IP they come from (both must be correct before it will allow a login)
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0