Operating System - HP-UX
1832907 Members
3792 Online
110048 Solutions
New Discussion

SSH self authentication not happening on NNM server

 
SOLVED
Go to solution
harsha_b
Frequent Advisor

SSH self authentication not happening on NNM server

Hi,

I have done the key exchange across NNM & PI servers. ssh is happening from NNM to PI server without password.
But in NNM server self authentication of ssh is not happening.
I have followed the following steps for ssh key exchange as root:
1.ssh-keygen -t rsa
2.concatinated authorized_keys file with the key generated in id_rsa.pub

But when I do ssh username@ it is asking for password.

Please help me in this...

Thanks
8 REPLIES 8
nijokj
Trusted Contributor

Re: SSH self authentication not happening on NNM server

have you append autherised_keys file of the user you want to ssh with the public key created under /.ssh directory.
Apart from this make sure that the users home directory and .ssh dir permission.
Can you post ssh -v user@IP output.
also check syslog.log for additional info.


Tim Nelson
Honored Contributor

Re: SSH self authentication not happening on NNM server

>But in NNM server self authentication of ssh is not happening.

you wish to ssh from the localhost to the localhost ?

if so,
on local host you need to put the same authorized_keys file in /.ssh/

when all else fails check /var/adm/syslog/syslog.log
INH
Regular Advisor

Re: SSH self authentication not happening on NNM server

Hello,

Add username at the end of the key in rsa.pib file

e.g
.....(truncated)..j5XUpmgcr2cyz/gQ== user_name@host_name

Rgds,
INH
Knowledge is power
harsha_b
Frequent Advisor

Re: SSH self authentication not happening on NNM server

Hi Nijkoi,

please find the attached output of "ssh -v user@"
Should I add the generated key in any file other than authorized_keys also?

Thanks
INH
Regular Advisor

Re: SSH self authentication not happening on NNM server

These instructions deal with the setup of ssh public / private key pairs which are used for ssh connections (such as sftp, scp and ssh) between a server and another system

1. Log in to the relevant unix server using the userid that the other system will log in with user name

2. Create a sub directory under the useridâ s home directory called .ssh (in this case it would be /home/user_name/.ssh)

3. Ensure that the following permissions are applied to this directory:

drwxr-xr-x .ssh

4. Change to that directory

5. Run the unix command â ssh-keygenâ . Press [ENTER] to all questions promoted by this command

6. When completed there should be two files in the directory, â id_rsaâ and â id_rsa.pubâ . The â id_rsa.pubâ file should be sent to the other systems team to generate their public/private key pair.

7. Ensure that the following permissions are applied to these files:

-rw------- id_rsa
-rw-r--r-- id_rsa.pub

8. Create a new file in the .ssh directory called â authorized_keysâ and insert the public key provided by the target system wishing to sftp to this server. The key must always start with the text â ssh-rsaâ and will end with â ==â . Make sure that the key provided is pasted exactly as provided and that it is on a single line within this file. Each separate key will be on a new line but will have the â ssh-rsaâ at the start and â ==â at the end. There may be text after the â ==â however this is just comment text.

9. Ensure that the following permissions are applied to this file:

-rw-r--r-- authorized_keys

Knowledge is power
INH
Regular Advisor
Solution

Re: SSH self authentication not happening on NNM server

the above same text is attached in notepad for clear visibility. PFA. Hope that helps
Knowledge is power
harsha_b
Frequent Advisor

Re: SSH self authentication not happening on NNM server

Hi INH,

your reply solved my problem... permissions of authorized_keys file was not proper.
Thank you!!
harsha_b
Frequent Advisor

Re: SSH self authentication not happening on NNM server

The permissions for authorized_keys file was not proper. It should be "-rw-r--r--"