1828377 Members
3300 Online
109977 Solutions
New Discussion

ssh keygen

 
SOLVED
Go to solution
himacs
Super Advisor

ssh keygen

Hi Admns,

I have generated ssh keys using ssh-keygen in server A and server B.
and i have copied id_rsa.pub of server A in to server B as authorized_keys.But bothways its asking password.anything more i have to do

regards
himacs
8 REPLIES 8
Gokul Chandola
Trusted Contributor

Re: ssh keygen

Hi,

Read the following links, may be usefull..

http://www.tek-tips.com/faqs.cfm?fid=5600

http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1250433458683+28353475&threadId=952222

Regards,
Gokul Chandola
There is always some scope for improvment.
Steven Schweda
Honored Contributor

Re: ssh keygen

> [...] anything more i have to do

As a start, ...

You might do a Forum search, and read some of
the dozens of SSH-related threads.

You might use some actual commands ("ls -l",
say) to show more than your vague
description.

You might use "ssh -v [...]" to show what's
happening on the client.

You might look in the system logs on the
server to see what's happening there.
himacs
Super Advisor

Re: ssh keygen

Hi Admins,

Thanx for the replies..

Ihave run ssh -v command and found the output

ssh -v noormon@10.248.8.12
OpenSSH_4.3p2-hpn, OpenSSL 0.9.7i 14 Oct 2005
HP-UX Secure Shell-A.04.30.007, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: Connecting to 10.248.8.12 [10.248.8.12] port 22.
debug1: Connection established.
debug1: identity file /home/noormon/.ssh/id_rsa type 1
debug1: identity file /home/noormon/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.5p1+sftpfilecontrol-v1.1-hpn12v14
debug1: match: OpenSSH_4.5p1+sftpfilecontrol-v1.1-hpn12v14 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3p2-hpn
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 '10.248.8.12' is known and matches the RSA host key.
debug1: Found key in /home/noormon/.ssh/known_hosts:8
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
This is a private network system operated for and by NIB. Authorization from NIB is required to use this system. Any unauthor
ized access to the system is prohibited and all the access to this system will be monitored.
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/noormon/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/noormon/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive

Plz tell me whats the error here

regards
himacs

himacs
Super Advisor

Re: ssh keygen

Hi Admins,

I think during Offering public key: /home/noormon/.ssh/id_rsa step its failing.

and i have regenerated the ssh-keygen in server B and but result is same.


plz any help on this



himacs
Sudeesh
Respected Contributor

Re: ssh keygen

Pls verify the permossion on home folder and $HOME/.ssh folder for the user you have generated the key. User should own the folders and permission should be limited just to the user.


Sudeesh
The most predictable thing in life is its unpredictability
Steven Schweda
Honored Contributor

Re: ssh keygen

> debug1: Offering public key: /home/noormon/.ssh/id_rsa
> debug1: Authentications that can continue: publickey,password,keyboard-interactive

The remote host rejected this key.

> debug1: Trying private key: /home/noormon/.ssh/id_dsa
> debug1: Next authentication method: keyboard-interactive

The remote host rejected this key.

> I have generated ssh keys using ssh-keygen
> in server A and server B.

What, exactly, did you do? Did you generate
two sets of key files (one set on each
server), or one set (for both servers)?
(Why?)

> [...] i have copied id_rsa.pub of server A
> in to server B as authorized_keys.

What, exactly, did you do? Did you copy
files from A to B, or A to B and B to A, or
what? Which files? From where? To where?

> You might do a Forum search [...]

Still true. Similar problems have been
solved many times before. (Similar problems
have also been described better before.)

My psychic powers are too weak to show me
what's in your "~/.ssh" directories, or
what's in the files there. Similarly, I
can't see the system log files on these
systems. With no help from you, I can't do
much.
himacs
Super Advisor

Re: ssh keygen

Hi Issue solved

it was the permission issue

home folder had full 777 permission
i made it to 755
its worked


thanx to all

regards
himacs
Bill Hassell
Honored Contributor
Solution

Re: ssh keygen

As mentioned, permissions are critically important. 777 is ALWAYS a bad permission. For the $HOME directory, it means that every user can completely trash your files. ssh checks the $HOME directory (must be writable only for owner), then the .ssh directory (must be 700 owned by the user) and finally all the files in .ssh must be 600 for consistent (and safe) operation.


Bill Hassell, sysadmin