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

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ssh to 100s of hosts with password in a shell script or text file
# 1  
Old 01-28-2014
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 ?
# 2  
Old 01-28-2014
Best to find an easy way install sshpass... even if you must use "sneaker net".
# 3  
Old 01-28-2014
You can also try out "expect"..or initially use "expect" to install the ssh-keys and then on use ssh-keys for logins
# 4  
Old 01-28-2014
Just adding my two cents here. What OS / shell are you using, both on the client and on the server? What are you exactly trying to do? (Please provide current status and desired scenario). Maybe there's some other way to accomplish this.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies

2. Shell Programming and Scripting

Encrypt Password file and decrypt in a shell script

Hi All, I have stored Oracle database passwords in a hidden file - .pass_file. My shell script reads the hidden file, gets the password and then logs in to the Oracle database and runs some SQL script. My requirement is: I need to provide the shell script to be executed by someone else. So,... (1 Reply)
Discussion started by: sunpraveen
1 Replies

3. Red Hat

Force ssl/ssh to use the hosts file

does anyone know how to force ssh/ssl to use the hosts file instead of DNS? I have disabled the DNS servers but ssh still will not resolve a host in the hosts file. thanks in advance for the help! DS (3 Replies)
Discussion started by: derrell simpson
3 Replies

4. Shell Programming and Scripting

SSH to remote hosts in shell scripting

Hi There, I have a file contaning some 100 servers names one by one the file called redhat_servers.txt I want to prepare a script where it should give me the host name and kernal version. I wrote like this, #!/bin/bash while read line do ssh $line "uname -nr" done <... (3 Replies)
Discussion started by: kumar85shiv
3 Replies

5. 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

6. Shell Programming and Scripting

when i use ssh in my shell script it will promt for a password :(

when i use ssh in my ssh in my shell script it is promt for the password my command is ssh user@server ls -l >log.txt can some one suggest if i am doing wrong. i dont want the script will prompt for a password promt. my requirement is the shell script will take the password inside the... (2 Replies)
Discussion started by: alokjyotibal
2 Replies

7. Shell Programming and Scripting

Help with shell script which logins to hosts

By a shell script When I am logging into hosts one by one with ssh. I am getting below message. Pseudo-terminal will not be allocated because stdin is not a terminal. stty: : Invalid argument stty: : Invalid argument Can you please suggest what should I do to stop this? ... (10 Replies)
Discussion started by: KuldeepSinghTCS
10 Replies

8. OS X (Apple)

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. ... (6 Replies)
Discussion started by: yoyoyo777
6 Replies

9. Shell Programming and Scripting

shell script to ssh a file

hi all, needed some help writing a script (preferably in ksh) which : 1) detects if a file with ext '.kbs' has been changed. This file always sits in a particular dir. 2) if file has been changed then scp that file from one serverA to another serverB. so far i have not done any... (2 Replies)
Discussion started by: cesarNZ
2 Replies

10. Shell Programming and Scripting

ssh - passing password in shell script

I have a requirement, I need to run a command at remote system using a ssh. Is there any way we can pass the username and password in shell script to the ssh command as we did it in one of the shell script for FTP. ftp -n $i <<!EOF >> user Username $PASSWD cd /home/scripts ... (5 Replies)
Discussion started by: Muktesh
5 Replies
Login or Register to Ask a Question