![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| log session | mm00123 | Linux | 15 | 03-24-2008 03:27 AM |
| sqlplus session being able to see unix variables session within a script | 435 Gavea | Shell Programming and Scripting | 2 | 07-03-2006 10:11 AM |
| Inactive Session | lowtaiwah | UNIX for Dummies Questions & Answers | 12 | 06-21-2006 11:37 PM |
| Telnet Session | pathanjalireddy | Shell Programming and Scripting | 6 | 04-06-2005 10:41 AM |
| is it possible to ssh within an ssh session? | noamkrief | UNIX for Dummies Questions & Answers | 4 | 11-14-2003 05:16 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
scripting an ssh session?
I know the root login/password for a machines, and I want to automate some commands like this from each:
Code:
ssh root@remoteHost1 "tail /var/log/messages" ssh root@remoteHost2 "tail /var/log/messages" ssh root@remoteHost3 "tail /var/log/messages" ssh root@remoteHost4 "tail /var/log/messages" ssh root@remoteHost5 "tail /var/log/messages" Is this doable? or is it possible to constantly check STDIN, and when it matches /password\:/ then I pipe it my password, and if it matches /\(yes\/no\)/ then I know to pipe it "yes"... but then how would I mimic the enter key, cause Im pretty sure "\n" is not enter, but just a new line any help here? |
|
||||
|
1. Get your public key into the image.
* OR * 2. Get the people who do the re-imaging to re-install your key when they re-image. * OR * 3. ssh to your own machine taking an input file but use the option to allocate a pseudo-terminal, then in that ssh shell do the ssh to the actual target. Basically to get the password entered you should have a terminal allocated. |
|
||||
|
Thanks for the reply
I think I found a CPAN module that will allow me to use both a username and password Net::SSH Seems like it is a fully loaded SSH session within Perl, so will do what I need it to. |
| Sponsored Links | ||
|
|