LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-02-2008, 07:28 PM   #1
noir911
Member
 
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
SSH password automation


I am using ssh-copy-id(1) to distribute ssh keys to servers. I am using a shell script. But the problem is I need to type the password every time ssh-copy-id copies the key to a server. So if I were to distribute the key to 100 servers I need to type the same password 100 times. Is there any simple way to automate this?

Thanks for any help. Here's the script I am using:

Code:
#!/bin/sh

for i in server1 server2 server3;
do
        ssh-copy-id -i ssh_key.pub username@$i
done
 
Old 06-02-2008, 10:38 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256
Learn expect. http://expect.nist.gov/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh with password adnanm Linux - Newbie 6 03-25-2011 11:08 AM
SSH without password thefountainhead100 Linux - Kernel 8 03-16-2008 02:54 AM
ssh automation stopped working lin2winwin Linux - Networking 2 12-05-2007 10:58 AM
need help with no password ssh and ssh-agent hedpe Linux - Networking 3 02-08-2007 08:49 PM
password less SSH maaand Linux - Networking 0 04-23-2002 08:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration