|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello ,
I have a problem which involves a set of command should be executed on remote host and output should be stored in a file. But due to security reason I can not use expect to enter the password and its not possible to create password less login for multiple user to do the same thing and we can not set one user to do this task. I have to write only shell script to do this . Perl/Python is not suggested in my environment. However perl/python can be taken under consideration if it doesn't involves us to install any extra module. Perl/Python script should not require any extra module which needs to be installed or does not comes with the default installation. Let me know if any one have any idea about it. ![]() |
| Sponsored Links | |
|
|
|
#2
|
||||
|
||||
|
So, you intend to type in the password every time for each server?
--ahamed |
| Sponsored Links | ||
|
|
|
#3
|
|||
|
|||
|
Yeah as of now it seems to be that only. But is there any way that can be achieved? Is there any way to write my own expect function?
If that is possible I can do it . But I am not that smart in scripting yet. Thank you |
|
#4
|
||||
|
||||
|
This can give you a start... Code:
#!/bin/bash
user="admin"
hostlist="127.0.0.1 127.0.0.2 127.0.0.3"
for host in $hostlist
do
echo $user@$host >> /tmp/log
ssh $user@$host "ps" >> /tmp/log
doneThe output is stored in the /tmp/log file. It will ask for password and you need to enter it! --ahamed |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Thanks but , is there a way to write a function which should act like expect or Net::SSH.
![]() |
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
What do you mean by "act"?? Please elaborate.
--ahamed |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Without expect you can try with as below ... But this is working on Solaris serves only ... Code:
# echo -e "ur-psw" | rsh <seever-ip" -- Shirish Shukla Last edited by Franklin52; 02-08-2012 at 06:16 AM.. Reason: Please use code tags for code and data samples, thank you |
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Plz help me using expect script for remote host | wormym | Shell Programming and Scripting | 2 | 09-16-2011 12:13 AM |
| Expect get host ip | rpowell86 | Shell Programming and Scripting | 2 | 06-29-2011 01:34 AM |
| how to handle multiple apps on host? | bongo | UNIX for Dummies Questions & Answers | 0 | 09-28-2010 01:47 PM |
| rsh login to host with password | topy | Shell Programming and Scripting | 11 | 05-03-2010 02:31 AM |
| change password for multiple host | chang-lee | Shell Programming and Scripting | 3 | 11-06-2009 09:29 AM |
|
|