Multiple hosts SSH NO PASSWORD - each time it overrides the last key gen

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Multiple hosts SSH NO PASSWORD - each time it overrides the last key gen
# 1  
Old 04-05-2010
Multiple hosts SSH NO PASSWORD - each time it overrides the last key gen

Hello, here is my problem:

I have 20 machines that need to SSH into 1 machine throughout the day. The issue is every time I go through the process of putting my keys from one of the computers that needs to SSH to the server that needs to accept all the incoming SSH's it overrides the last one.

How do I tell the 1 computer that needs to be SSHed into from the other 20; all the keys of the 20, or maybe 1 file that contains all 20 key files from the computers that need to all connect to the 1 without entering password.

Thanks in advance.
# 2  
Old 04-06-2010
Say the machine A is the machine to which the other 20 will ssh.

In Machine A you need to populate the authorized_keys file . Add the id_rsa.pub containt of each 20 machines in Machine A 's authorized file.

Now you can login from 20 machines without password
# 3  
Old 04-06-2010
Again, as I told you in your other thread, search the forums first. And reading the documentation yourself wouldn't hurt either, even if it forces you to think for yourself instead of getting everything done by others.

If you just copy over the public key, or pipe into it using a single angle bracket, of course you'll overwrite it again and again. On each of the machines that should connect to the one in the center, run this
Code:
cat .ssh/id_rsa.pub | ssh user@target 'cat >> .ssh/authorized_keys'

Or install the new OpenSSH release, and create the appropriate certificates.
# 4  
Old 04-06-2010
Excellent. That works and I appreciate it.

Now the next issue is that it takes FOREVER to SSH into the box. Over a minute, but it eventually goes through.... What do you think about that? Thnx
# 5  
Old 04-06-2010
Do you have an proper DNS infrastructure in place? If not, that's your problem. With each connection, the SSH daemon will try and do an reverse lookup of your IP, and check if it matches the sent hostname. A reverse lookup without an appropriate record consumes time. Change/Add the directive
Code:
UseDNS no

, and the issue should disappear.
# 6  
Old 04-07-2010
Can you elaborate on this? Where do I enter this info?
# 7  
Old 04-07-2010
Sorry. That line belongs in your sshd_config, which should be somewhere below /etc. Usually, that line is already in there as
Code:
#UseDNS yes

which is the default.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ssh to validate multiple remote hosts connection validation.

Dear Folks, I am trying to read a config file contains ip and port numbers. i want to read each line of the config file and check ssh connection is happening or not. Kindly guide. Config file: abc@1.2.342 22 abc@1.2.343 22 abc@1.2.344 22 abc@1.2.345 22... (9 Replies)
Discussion started by: sadique.manzar
9 Replies

2. Shell Programming and Scripting

Ssh to multiple hosts and then run multiple for loops under remote session

Hello, I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out. I am specifically facing issues while running for loops. I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Discussion started by: mohit_vardhani
2 Replies

3. UNIX for Dummies Questions & Answers

How to search using ssh on multiple hosts?

Hi guys - I am having a hard time trying to figure how to search for a certain string on config files hosted on multiple hosts. This is an example: Hostnames: myhost1.mycompany.com|myhost2.mycompany.com|myhost3.mycompany.com String to search for: myipaddress.somehost.com Directory... (9 Replies)
Discussion started by: DallasT
9 Replies

4. Shell Programming and Scripting

Ssh to 100s of hosts with password in a shell script or text file

I have about 500 hosts where I need to ssh by sending the password on the command line or in a text file in a clear text . However I am not able to download "sshpass" or other tools . Any other ways to pass the password in a script ? (3 Replies)
Discussion started by: gubbu
3 Replies

5. Shell Programming and Scripting

Bash Loop for password gen

Hey guys, I'm trying to make a bash script to do password generation. The script takes 2 arguments, number of characters and number of passes to generate, but I can't get the loop to work properly. #!/bin/bash echo echo echo -ne "Password length:" read pwd_length echo echo -ne "Number of... (6 Replies)
Discussion started by: 3therk1ll
6 Replies

6. Shell Programming and Scripting

Remove Duplicates on multiple Key Columns and get the Latest Record from Date/Time Column

Hi Experts , we have a CDC file where we need to get the latest record of the Key columns Key Columns will be CDC_FLAG and SRC_PMTN_I and fetch the latest record from the CDC_PRCS_TS Can we do it with a single awk command. Please help.... (3 Replies)
Discussion started by: vijaykodukula
3 Replies

7. Shell Programming and Scripting

Logon to multiple hosts using ssh hardcode password

Hi im trying to write a script to logon to list of servers with same userID. I have no option/plan to implement ssh-keygen sharing between the systems, so i have written script creating 2 files, file1 holds list of hosts host1 host2 host3 file2 has following script for i in `cat file1`... (1 Reply)
Discussion started by: dreamaix
1 Replies

8. Shell Programming and Scripting

ssh to multiple hosts and saving the output in the local host

hi I have a script to login from a host "A" to a list of hosts in a file and perform some commands inside it...its somethin like this for i in `cat file` do ssh -t $i " command1 ; command2; ..." done I wanna save the outputs in a file in the current host "A" i.e from where I am... (3 Replies)
Discussion started by: ningy
3 Replies

9. AIX

While trying to do ssh without password, rsa key file is created as empty.

Hi i have aix 5.3 operating system, and i am trying to do ssh without passwd, when i tried to create a rsakey, it produces empty file as an output, how can solve that problem? why it is giving empty output file, i tried with different user, situation same,.i have restarted sshd server. .ssh... (2 Replies)
Discussion started by: nibiru78
2 Replies

10. UNIX and Linux Applications

SSH: Avoiding password prompt with rsa key generation

Hi, I am using a remote storage service for backing up our data - we want to have a script run as part of a cron job which would do the backups from our local Linux machine to the service's Linux machine. I want to use tar and ssh to do this (rather than mounting the disk and using cp) .... (5 Replies)
Discussion started by: same1290
5 Replies
Login or Register to Ask a Question