Login to remote machine pass commands and capture all in a file
Dear user/friends,
After a long gap of 6 years i am back to this forum to find a solution and i hope i will get a solution or atleast a workaround for the problem
Following is my task which i am trying for almost 3 days without any success.
1) run this command from my terminal (note i cannot change this command or alter)
2) This will login to remote machine with some banner messages it will ask me to select from list of free ports e.g.,
3) Now i need to pass any of these free port numbers i.e., 17 or 20 or 24 on remote terminal
Once port number is provided it will display the following:
4) now i need to pass
and press enter button
It will display the following (Similarly i need to pass the password and press enter)
5) Once password is provided it will display the following
6) now i need to provide my command e.g., runjob
Once the above command is provided it will run for some time lets say for 2 mins or 5 mins
once completed it will display
here i need to provide the command as:
(control key plus the closing square bracket)
then it will display following:
again i need to pass
and press Enter
I will be really thankful if someone can provide me how to solve this problem.
Moderator's Comments:
Please review the rules you agreed to when you joined this forum 6+ years ago. Use CODE tags whenever you post sample input, sample output, and code segments.
Last edited by Don Cragun; 01-30-2016 at 03:07 AM..
Reason: Change most Bold tags to CODE and ICODE tags.
Hi,
I have a file xyz.txt, which contains several "tar.gz" package names
Eg :-
Now i need to execute an rpm - ivh against all those packages in this file through a script one by one.
I need a script to read through the file "xyz.txt", pick up each package name and execute rpm -ivh... (7 Replies)
I am trying to write a perl script that will do remote machine.
I have done user loging using simple command;
$telnet->login('test', 'test123');
But now I want to do root login or superuser login. So I tried the superuser command,
$telnet->cmd("su");
But I am not able to send the... (0 Replies)
HI,
I need to write a script ..
when I run this script , will directly goto that remote machine without asking password..
Once it is entered, I needs to transfer some of the log files...
how can I proceed ? (7 Replies)
Hi All,
URGENT - Please help me form a scipt for this:
I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server)
I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Hi,
I work on a jumpserver and I wrote a script to transfer a file from source server to destination server.
#!/bin/ksh
echo "\nEnter the file name:\n"
read name
echo "\nSelect the Source server\n"
echo "1. ODS PROD "
echo "2. ODS DROPBOX"
echo "3. ODS STE"
echo "4. ODS STE DROPBOX"... (6 Replies)
hey guys,
I've done some searching and other than winexe I haven't been able to find a way to send remote commands to a windows machine. The problem I get is with winexe whenever you send the process to the background in a script, I get the following error. :wall: Any help is appreciated!
... (0 Replies)
Hi,
i want to write script where it will login into 50 hosts and if login is successful it print message "login to host1 is
successful" if not it should print message "Not able to login to host1". once connection to the host is succesful it should fire df command to check filesystem if df is... (3 Replies)
Hi All,
I am working in support and we are planning to automate a system to reduce the direct manual intervention to core system.
Please find the below details.
1. we have a web application that runs on Windows Platform.
2. From web application, we need to connect to remote Unix machine.... (6 Replies)
Hi Friends,
I am unable to run our application commands on remote server using ssh (passwordless login enabled). But the same command running with telent perl script. please suggest.
SSH:
C:/bin>ssh -l monitor tl04cp01 exec "/home/monitor/123"
/home/monitor/123: viewlog: not found.
... (7 Replies)