ssh public key setup questions.


 
Thread Tools Search this Thread
Operating Systems AIX ssh public key setup questions.
Prev   Next
# 1  
Old 10-28-2009
ssh public key setup questions.

Hi all,

I have N number of AIX hosts, where I need to login frequently and do some routine tasks (run some scripts). I need to setup ssh public/private key, so I can auto-login via a master (wrapper) script and run each script in each server.

I am trying to setup/generate ssh keys, but am facing some problems. Here's what I have done:

- Generate ssh keys, as follow:
Code:
haroon_a@myhost1:/home/haroon_a/.ssh > ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/haroon_a/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/haroon_a/.ssh/id_rsa.
Your public key has been saved in /home/haroon_a/.ssh/id_rsa.pub.
The key fingerprint is:
a2:92:49:ed:a8:c6:18:9d:ec:64:f5:fe:70:e7:09:fe haroon_a@myhost1
haroon_a@myhost1:/home/haroon_a/.ssh > ls -ltr
total 3
-rw-r-----   1 nbkysrj  staff           232 Oct 28 07:59 id_rsa.pub
-rw-------   1 nbkysrj  staff           887 Oct 28 07:59 id_rsa
haroon_a@myhost1:/home/haroon_a/.ssh > scp id_rsa.pub haroon_a@myhost2:.ssh/authorized_keys2

- So now id_rsa.pub is copied over to my host2:/home/haroon_a/.ssh/.
- When I try to do an ssh login either from host1 to host2 or from host2 to host1, the ssh login doesn't work. It still asks me for password.

- Can someone tell me what I'm missing here?

Thanks in advance.


Haroon A.

---------- Post updated at 11:03 AM ---------- Previous update was at 10:19 AM ----------

I got the ssh auto-login to work. But here's my other question now:

- Like I mentioned, I have N number of hosts, where I need to run some scripts on a regular basis. So, here's what I have in mind.

1. Create a script in host1 to wrap arround all other scripts in other hosts (host2, host2, host4) and execute each scripts in all other hosts. i.e. something like this:

Code:
ssh to host2
execute script1
execute script2
 
ssh to host3
execute script1
execute script2
 
ssh to host4
execute script1
execute script2

But as soon as the ssh host2, is executed--the first line--, then I am taken to host2, and I'm out of the script (which is in host1).

Am I making any sense? Please advise...

Thanks.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Public private key setup issue in Solaris 10

Hi i am using solaris 10.I am trying to setup a public/private key but it is not working.Appreciate your repsonse on it There are two servers DB1 server and DB2 server. 1)I have generated public/private key using below step on both servers. ssh-keygen -t rsa 2)From DB1 server moved the... (6 Replies)
Discussion started by: muraliinfy04
6 Replies

2. UNIX for Advanced & Expert Users

SSH public key failing without error message

My password-free ssh connection has worked in the past but has stopped working and I can't get it going again. The files in .ssh on both source and target are set to 600: drwx------ 2 ingres 1024 Mar 2 13:57 . drwxr-xr-x 25 ingres 2048 Mar 29 09:38 .. -rw------- 1 ingres ... (9 Replies)
Discussion started by: Catullus
9 Replies

3. UNIX for Dummies Questions & Answers

how to create a public/private key using ssh-keygen

Hi, please guide me create a public/private key using ssh-keygen, lets say I have been access to server named pngpcdb1with a userid and password ...!!! and also please explain in detail the concept of these keys and ssh as I was planning to use them in ftp related scripts..! Thanks in... (1 Reply)
Discussion started by: rahul125
1 Replies

4. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

5. Red Hat

SSH Public key Authentication Issue

Hi All; I have an issue with password less authentication via ssh ( v2) I have two servers Server A and Server B, following are the server details Server A OS - HP UX B.11.11 U 9000/800 SSH - OpenSSH_4.3p2-hpn, OpenSSL 0.9.7i 14 Oct 2005 HP-UX Secure Shell-A.04.30.000, HP-UX... (3 Replies)
Discussion started by: maverick_here
3 Replies

6. UNIX for Advanced & Expert Users

Generate Public key for non ssh enabled servers

I am writing a script that needs to access various servers some of which are not ssh enabled. In order to access the ssh enabled servers I am using the following command to generate the public key : ssh-keygen -t rsa Is there a similar command for the other servers as well. If I try to use... (1 Reply)
Discussion started by: ravneet123
1 Replies

7. Shell Programming and Scripting

Generate Public Key when the server is not ssh enabled

I am writing a script that needs to access various servers some of which are not ssh enabled. In order to access the ssh enabled servers I am using the following command to generate the public key : ssh-keygen -t rsa Is there a similar command for the other servers as well. If I try to use... (1 Reply)
Discussion started by: ravneet123
1 Replies

8. UNIX for Advanced & Expert Users

Setting Up public key on Windows for ssh/scp

Hi, I am trying to scp a file from our Unix server to the local Windows machine.I have created the key pair in Unix server using ssh-keygen command in unix. But I am not sure where can we put the public key(generated on Unix) in Windows machine so that scp from Unix machine to Windows is... (3 Replies)
Discussion started by: dennis.jacob
3 Replies

9. UNIX for Advanced & Expert Users

SSH - Public key

When should one have to generate a public key on a Server when the public key is already created and used by other clients? Thanks, Rahul. (6 Replies)
Discussion started by: rahulrathod
6 Replies

10. Shell Programming and Scripting

SSH Public key method

do we need root access for the remote server to ssh without a password(i.e by using id_rsa.pub method)??? (1 Reply)
Discussion started by: roshanjain2
1 Replies
Login or Register to Ask a Question