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
file2 has following script
so each time i run the script it ask me for password, so if i have 100 hosts on list i have to enter password 100 times for each host.
so i just want to know if there a way to hardcode password for user in the same script, perl script, shell script or bash, csh any script that will support this?
btw i do not have "expect utility" as well. i know it would be good to have it.
any help is much appreciated.
DreamAix
Last edited by Franklin52; 06-04-2012 at 03:32 AM..
Reason: Please use code tags
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)
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)
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)
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)
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)
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)
OS: Linux ambglx02 2.6.16.60-0.21-default #1 Tue May 6 12:41:02 UTC 2008 i686 i686 i386 GNU/Linux
Shell: bash
Currently I have a mysqldump script to backup my mysql database, the command is as below:
/opt/novell/mysql/bin/mysqldump --add-drop-table -u root -p -h mydb > /home/john/mydb.sql
... (5 Replies)
Hi
I am envountring a problem while I login using ssh on a sun box to a remote box.
I use ssh user@server and it takes long time to ask for a password..
does anyone knows the reason behind this? or is there a way that this could be solved
Thanks,
Antony (8 Replies)
Dear all
i want to ssh to a server via running a shell script with a username and i want to hard code the password for that particular username
can u help me please
Thank u
Naree (8 Replies)
Hi, I need to run a command remotely, rsh is disabled so I'm trying to do this:
ssh myserver ls -lst /work/jsf
The problem is that this prompts for a password and I want to do it in a shell script. How can I pass the password without user interaction? I tried "echo mypass | ssh_command" and... (1 Reply)