The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passwordless authentication for AIX gsabarinath AIX 11 04-05-2009 06:28 PM
Passwordless SSH from Unix to Solaris BillSchuchardt Shell Programming and Scripting 4 09-11-2008 05:38 PM
Passwordless SFTP manneni prakash Shell Programming and Scripting 2 06-20-2008 02:10 AM
authorized_keys and passwordless login mcrouch_2003 Red Hat 6 05-09-2008 01:28 PM
Passwordless authentication via SSH RegX AIX 1 08-29-2007 09:42 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-07-2009
EmbedUX EmbedUX is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 20
Cool Help on passwordless ssh...

Hi,

Can someone help me on ssh-keygen usage...?

I used ssh-keygen after which "id.pub" file was generated in system1's > .ssh directory...

I copied the same into the remote system system2 > .ssh directory as "authorized_keys" file.

Now i tried ssh connection from system 1 to system 2..... but it is still asking for password on system 2....

Can anybody help me on this please ???
  #2 (permalink)  
Old 10-07-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,568
Why didnt you use ssh-keygen -t dsa?
would have produced something like:
Code:
Generating public/private dsa key pair.
Enter file in which to save the key (/home/vbe/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/vbe/.ssh/id_dsa.
Your public key has been saved in /home/vbe/.ssh/id_dsa.pub.
...
which works for me...
  #3 (permalink)  
Old 10-08-2009
EmbedUX EmbedUX is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 20
Hi vbe,

I have used the same command ssh-keygen -t dsa
It did ask me for a file name and .pub file was also generated.
Then I created a duplicate copy of the .pub file as authorized_keys and ftp to the remote machine.
Now it should not ask me for password when I try to ssh to the remote machine.....but it is asking for the password........

How do I achieve passwordless login.....is the above procedure correct ??
  #4 (permalink)  
Old 10-08-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,568
The mistake was to use ftp...
We assume sshd is running on both boxes, and so you should have transfered the file using scp, doing so you would have known if sshd is up on the remote server since it would have asked you the password...
Once transefred you could have tested again and it should have worked...
So start by checking if sshd is up on both servers then maybe check for incompatibilities (version differ too much?...)
  #5 (permalink)  
Old 10-08-2009
EmbedUX EmbedUX is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 20
Thank you very much for the correction.....

There is a small correction in my reply above.....

The .pub file that was generated, I copied it into the remote system by means of ftp.
Then I logged off from ftp...and on system 1 i tried connecting to system2 by ssh.....

ftp was used only for copying authorized_keys file to remote machine.....
I tried using scp to copy the file but i am getting permission denied error inspite of changing all the file and directory permissions on both the systems to rw-r--r-- and rwzrw-rw- respectively....

Please suggest on the same...

Thanks in advance...
  #6 (permalink)  
Old 10-08-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,568
Code:
ant:/home/vbe $ cat 4ux.com.txt 
i
dr-xr-xr-x   2 tftp       other           96 Mar 13  2003 tftpdir
drwxrwxr-x  18 vbe        bin           3072 Jan  6 12:35 vbe
ant:/home $ chmod 755 vbe
ant:/home $ sh^H ^Hsh tp72f
The authenticity of host 'tp72f (1.2.3.4)' can't be established.
RSA key fingerprint is 65:00:f7:e5:33:6a:40:6c:00:14:92:2b:b3:82:20:83.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'tp72f,1.2.3.4' (RSA) to the list of known hosts.

|-----------------------------------------------------------------|
| This system is for the use of authorized users only.            |
| Individuals using this computer system without authority, or in |
| excess of their authority, are subject to having all of their   |
| activities on this system monitored and recorded by system      |
| personnel.                                                      |
|                                                                 |
| In the course of monitoring individuals improperly using this   |
| system, or in the course of system maintenance, the activities  |
| of authorized users may also be monitored.                      |
|                                                                 |
| Anyone using this system expressly consents to such monitoring  |
| and is advised that if such monitoring reveals possible         |
| evidence of criminal activity, system personnel may provide the |
| evidence of such monitoring to law enforcement officials.       |
|-----------------------------------------------------------------|

vbe@tp72f's password:
Last login: Thu Jan  6 13:09:39 2005 from 6.7.8.9

|-----------------------------------------------------------------|
| This system is for the use of authorized users only.            |
| Individuals using this computer system without authority, or in |
| excess of their authority, are subject to having all of their   |
| activities on this system monitored and recorded by system      |
| personnel.                                                      |
|                                                                 |
| In the course of monitoring individuals improperly using this   |
| system, or in the course of system maintenance, the activities  |
| of authorized users may also be monitored.                      |
|                                                                 |
| Anyone using this system expressly consents to such monitoring  |
| and is advised that if such monitoring reveals possible         |
| evidence of criminal activity, system personnel may provide the |
| evidence of such monitoring to law enforcement officials.       |
|-----------------------------------------------------------------|

$ pwd
/export/home/vbe
$ exit
Connection to tp72f closed.
ant:/home/vbe $ scp authorized_keys tp72f:/export/home/vbe/.ssh/.
ant:/home $ cd .ssh                                          
ant:/home/vbe/.ssh $ scp authorized_keys tp72f:/export/home/vbe/.ssh/.

ant:/home/vbe/.ssh $ cd
ant:/home/vbe $ ssh tp72f                                  
ant:/home/vbe $

|-----------------------------------------------------------------|
| This system is for the use of authorized users only.            |
| Individuals using this computer system without authority, or in |
| excess of their authority, are subject to having all of their   |
| activities on this system monitored and recorded by system      |
| personnel.                                                      |
|                                                                 |
| In the course of monitoring individuals improperly using this   |
| system, or in the course of system maintenance, the activities  |
| of authorized users may also be monitored.                      |
|                                                                 |
| Anyone using this system expressly consents to such monitoring  |
| and is advised that if such monitoring reveals possible         |
| evidence of criminal activity, system personnel may provide the |
| evidence of such monitoring to law enforcement officials.       |
|-----------------------------------------------------------------|

Last login: Thu Jan  6 13:11:40 2005 from 6.7.8.9

|-----------------------------------------------------------------|
| This system is for the use of authorized users only.            |
| Individuals using this computer system without authority, or in |
| excess of their authority, are subject to having all of their   |
| activities on this system monitored and recorded by system      |
| personnel.                                                      |
|                                                                 |
| In the course of monitoring individuals improperly using this   |
| system, or in the course of system maintenance, the activities  |
| of authorized users may also be monitored.                      |
|                                                                 |
| Anyone using this system expressly consents to such monitoring  |
| and is advised that if such monitoring reveals possible         |
| evidence of criminal activity, system personnel may provide the |
| evidence of such monitoring to law enforcement officials.       |
|-----------------------------------------------------------------|

$ pwd
/export/home/vbe

$ exit
Connection to tp72f closed.
ant:/home/vbe $ exit

Last edited by vbe; 10-08-2009 at 11:25 AM..
  #7 (permalink)  
Old 10-08-2009
EmbedUX EmbedUX is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 20
Thank you for the information....

the user is not a root......

and the authorized_keys file is copied into /home/.ssh directory on remote system2.

I changed it to /home/newusr/.ssh/authorized_keys......

It worked fine.....I am able to ssh to remote system passwordless...


Thank you very much for the correction and valuable suggestions...
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0