How to auto telnet the server from another server using script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to auto telnet the server from another server using script
# 1  
Old 05-25-2011
Data How to auto telnet the server from another server using script

Hi All,
I have a problem with auto telnet script, but I want to tell u something
a) I am only a member access on the server, so not able to access 'root' account
b) not able to install any software on server
3) On server, there is not install 'except'

I have to write a script, which is ran from A server, login/telnet to B server, do 'ls -lrt' and send to me the output via mail.

I have only basic stucture....
** run from Server A
1) login to B
2) cd landing path
3) ls -l > a.txt
4) mail -s "Status" user@domain.com < a.txt
5) connection closed

I tried this, can you please hekp
Code:
telnet ServerB
echo user
sleep 1
echo password
sleep 1
cd landing_zone
ls -l > output.txt
mail -s "status" user@gmail.com < outout.txt
echo exit

Moderator's Comments:
Mod Comment Double post, continued here

Last edited by pludi; 05-25-2011 at 07:20 AM.. Reason: Please use code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Transfer file from server B to server C and running the script on server A

I have 3 servers A, B, C and server B is having some files in /u01/soa/ directory, these files i want to copy to server C, and i want to run the script from server A. Script(Server A) --> Files at Server B (Source server) --> Copy the files to Server C(Target Server). We dont have RSA key... (4 Replies)
Discussion started by: kiran_j
4 Replies

2. Cybersecurity

Web Server Allows Password Auto-Completion

Hi, After running 'nessus' tool to find the Vulnerability in server OS - RHEL 5 we got " Web Server Allows Password Auto-Completion (PCI-DSS variant)" link for description provided by tools - report Nessus Plugins | Tenable Network Security I have checked - Their is only... (1 Reply)
Discussion started by: saurabh84g
1 Replies

3. Shell Programming and Scripting

Auto Script to Access external Server via SFTP using Password and Key

Hello All, I am stuck! I have access to an external server via SFTP. In order to access the external server I was given a specific port, password, and a ppk. I would to create a script on my server end that can I can setup as a corn job, that will connect to the external server and... (1 Reply)
Discussion started by: kingr008
1 Replies

4. Shell Programming and Scripting

how do I infinite loop (reconnect) to auto disconnect telnet server

I want the text based Star Wars movie at towel.blinkenlights.nl to loop infinitely. It plays the movie and then disconnects my session? Can anyone think of a way to make my unix machine automatically reconnect over and over? EDIT no commands are required are the connection its just in and... (3 Replies)
Discussion started by: herot
3 Replies

5. Homework & Coursework Questions

How to auto telnet the server from another server?

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' 1. The problem statement, all variables... (8 Replies)
Discussion started by: atul9806
8 Replies

6. Homework & Coursework Questions

How to auto telnet the server from another server

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' 1. The problem statement, all variables... (0 Replies)
Discussion started by: atul9806
0 Replies

7. Solaris

Sun Server auto ping to 0.0.0.0

Hi All, 3 of my SAP sun server are continuosly pinging to the network address 0.0.0.0. I have no idea how this can happen, but they have something in common. All of them are clustered environment (Veritas Cluster). Anyone can help? rgds, (5 Replies)
Discussion started by: ronny_nch
5 Replies

8. Shell Programming and Scripting

Script to telnet web server

A similar script I wrote long time ago, it was working, but it was deleted and now for some reasons my new script doesnt work. I have been searching for a while in google but no luck so far. Can anyone help me to spot syntax errors with this little script here: #!/bin/sh { sleep 2 ... (5 Replies)
Discussion started by: bsddaemon
5 Replies

9. Programming

Auto FTP from UNIX to Windows Server

Hi, I am a not strong programmer and now my boss ask me how should I do a job to automated FTP that have error check. I know about: * using system() to call a command to trigger ftp in C Coding. The senarios as follows: 1. FTP the file(s) (e.g ELA_20060407.dat) to a given LAN server... (1 Reply)
Discussion started by: songtam
1 Replies

10. Shell Programming and Scripting

Auto FTP to a server

Hi, I am trying to automate FTP login to a remote server and put a file there. But no matter what i do, It still is aksing me for the login and password although i have it defined in the variable. Could you tell me what is wrong with this script. I am doing this on SUN server. Pls... (11 Replies)
Discussion started by: systemali
11 Replies
Login or Register to Ask a Question