Help on passwordless ssh...


 
Thread Tools Search this Thread
Operating Systems HP-UX Help on passwordless ssh...
# 1  
Old 10-07-2009
Tools 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  
Old 10-07-2009
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  
Old 10-08-2009
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  
Old 10-08-2009
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  
Old 10-08-2009
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  
Old 10-08-2009
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 12:25 PM..
# 7  
Old 10-08-2009
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...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Passwordless ssh for different user

Hello Folks, I lost touch in ssh key gen topics. I am in need of ssh to a server without password, kindly help me in configuring. I have two servers, server1 with user name apha & server1 with user name beta. I need to ssh to the server2 from server1 with respective users, Manually i... (3 Replies)
Discussion started by: Thala
3 Replies

2. Shell Programming and Scripting

Ssh passwordless authentication

Hey team I have to enable password less authentication betweeen A to B server and A to C server and A to D server. For this I generated a ssh key on server A using ssh-keygen command and copied the key using ssh-copy-id command to B, C and D server. Everything is working fine as of now but... (5 Replies)
Discussion started by: Sandeep_sandy
5 Replies

3. Solaris

Passwordless ssh for root

Hi Experts, I am trying to setup passwordless ssh for root between two of my solaris servers(say A & B). I have exchanged the public keys between both servers. Password less ssh working fine while I try to connect from Server A to Server B. However it is still asking password... (6 Replies)
Discussion started by: sai_2507
6 Replies

4. Ubuntu

Passwordless ssh authentication fails

Unable to set ssh passwordless authentication I am unable to ssh with passwordless authentication from Windows client onto UBuntu server. The ssh version on UBuntu is OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e , while SSH on Windows Client is OpenSSH_5.1p1, OpenSSL 0.9.8k. I turned on ssh... (5 Replies)
Discussion started by: tkota
5 Replies

5. UNIX for Advanced & Expert Users

Passwordless ssh

Hi I have created a user on a linux server and created a passwordless ssh key. I've echoed the key into the authorized_keys file for the user. I've added a series of forced commands to the key. From my laptop - logged in as myself - I can ssh into the server as that user and the commands... (3 Replies)
Discussion started by: steadyonabix
3 Replies

6. Shell Programming and Scripting

passwordless ssh

My main concern is, i have to login into 300 linux server and all are having same userid and password. I dont want to create any key for each server to login . Is there a way to run the shell script ? (3 Replies)
Discussion started by: Mani2512
3 Replies

7. UNIX for Dummies Questions & Answers

passwordless ssh

hi, i have tried with passwordless shh in google.. i followed the below steps ... user:~> ssh-keygen -t rsa Enter file in which to save the key (/home/cantin/.ssh/id_rsa):key.txt Enter passphrase (empty for no passphrase): Enter same passphrase again: till this step i... (0 Replies)
Discussion started by: arunmanas
0 Replies

8. AIX

passwordless ssh for non-root user???

hi all I have a problem to set up the password ssh login for a non-root user. what I want to do is that non-root user in host A logs into host B without password prompted. what I did listed as the following steps. 1. genarate a pair of keys from host A. ssy-keygen -t rsa -N "" -f... (9 Replies)
Discussion started by: rs6000er
9 Replies

9. Shell Programming and Scripting

ssh passwordless

Hi, I want to login to a remote server and sftp files without password prompting. So, I created private-public key pair as follows: user1@server1.com .ssh]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/user1/.ssh/id_rsa): Enter... (7 Replies)
Discussion started by: dips_ag
7 Replies

10. AIX

Passwordless authentication via SSH

I am trying to implement passwordless authentication via ssh2. I have used the well documented technique of generating a key pair with a blank passphrase on my client machine, and installing the public key on the destination server (AIX 5.3) in the user's .ssh2 directory. I have used this technique... (1 Reply)
Discussion started by: RegX
1 Replies
Login or Register to Ask a Question