LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 12-15-2006, 03:17 AM   #1
lmcilwain
Member
 
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 390

Rep: Reputation: 31
SSH key pairing


Hello all,

I am trying to set up ssh key pairing between my linux boxes and I can't seem to figure out what my issue is.

I generated my keys using
Code:
ssh-keygen -t dsa
I tried these two ways of installing the generated key on the other linux box.

scp the ida_dsa.pub file to the .ssh directory on the remote machine

tried sshing to the machine in verbose mode
Code:
ssh -v lmcilwain@remotelinux
I have also tried created an authorized_keys file in the remote linux .ssh directory and copying and pasting the key of the local linux machine in that filethen tried sshing in verbose mode to the local machine.

Here is my output, but I don't seem to be able to understand what I am doing wrong.

OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to remotelinux [ip.ad.dr.ess] port 22.
debug1: Connection established.
debug1: identity file /home/lmcilwain/.ssh/identity type -1
debug1: identity file /home/lmcilwain/.ssh/id_rsa type -1
debug1: identity file /home/lmcilwain/.ssh/id_dsa type 2
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.6.1p1+CAN
debug1: match: OpenSSH_3.6.1p1+CAN-2004-0175 pat OpenSSH_3.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'mordor' is known and matches the RSA host key.
debug1: Found key in /home/lmcilwain/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: gssapi,publickey,password,keyboard-int
debug1: Next authentication method: publickey
debug1: Trying private key: /home/lmcilwain/.ssh/identity
debug1: Trying private key: /home/lmcilwain/.ssh/id_rsa
debug1: Offering public key: /home/lmcilwain/.ssh/id_dsa
debug1: Authentications that can continue: gssapi,publickey,password,keyboard-int
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: gssapi,publickey,password,keyboard-int
debug1: Next authentication method: password
lmcilwain@remotelinux password:
 
Old 12-15-2006, 03:24 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
This is exactly what you need to do, supposing you have box1 and box2:

On box1:
generate keypair with ssh-keygen
copy id_[dsa|rsa].pub to ~/.ssh on box2

On box2
cd ~/.ssh
cat id_[dsa|rsa].pub >> authorized_keys

On box1
ssh box2 (this should now work)

On box2 simply repeat steps, switching box1 and box2 around


Do not use cut & paste, you might get bad line endings. Make sure you copy the entire file with scp if possible, then log into the box you copied it to and cat the .pub file with two '>'s to authorized_keys (make sure to use two '>'s not one, as two will append, but one will overwrite).
 
Old 12-15-2006, 03:32 AM   #3
lmcilwain
Member
 
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 390

Original Poster
Rep: Reputation: 31
That worked beautifully. Thanks for the help!
 
  


Reply



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
open-ssh vs. commercial ssh (tru64), public-key auth not possible? cf050 Linux - Networking 8 03-28-2012 11:15 AM
Bluetooth pairing Dj Blaze Linux - Laptop and Netbook 0 01-28-2006 05:46 AM
bluetooth pairing meknb Linux - Hardware 0 01-05-2006 05:06 PM
KbluetoothD not pairing with my mobile Twistedlizzard Linux - Newbie 2 06-21-2005 07:07 AM
ssh / ssh-key -- its always asking for passphrase BaerRS Linux - General 1 01-07-2003 06:21 PM

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

All times are GMT -5. The time now is 03:20 AM.

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