How can my unix shell script automatically connect to remote host?


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How can my unix shell script automatically connect to remote host?
# 1  
Question How can my unix shell script automatically connect to remote host?

How can my unix shell script automatically connect to remote host?

Assume that there is a remote host called "rhost". When I connect to that host i give the command "telnet rhost".

It then asks me for my id and password. Once i give it connects there.

I want to automate these steps. I want a shell script which will automatically connect to 'rhost'. I shall provide my userid and password in the shell script.

What i need is just to run that shell script and the script will connect me to 'rhost'.

CAN SOME ONE HELP ME TO WRITE THIS SCRIPT?

IT WOULD BE BETTER IF YOU CAN GIVE ME THE SCRIPT.

I WORK IN SOLARIS/ K-SHELL.

Thanks
Digdarshan
digdarshan
# 2  
This smacks of a homework question, and what's more this:

Quote:
IT WOULD BE BETTER IF YOU CAN GIVE ME THE SCRIPT
indicates you are particularly bad student. You shouldn't wish for people to just write you code on demmand.

Anyway this question has been asked many times before - search the forums.
# 3  
Of course if you are cunning there are ways where you don't need to provide a userid and password in the shell script Smilie Smilie Smilie
You just need to make both machines ..........
# 4  
automatic keying in SSH

Have a look at ssh. It features keyed authentication where you do not need to enter a username/password to connect to another machine. There are quite a few articles about this on the web (Daniel Robbins of Gentoo Linux has done a wonderful howto on this with openssh, and even offers a keyring tool called keychain).
# 5  
links please?

i'm quite interested in this myself now (of course i'm not doing it for my homework! Smilie neither is my pinky glued to the caps lock key Smilie )

thanks...
# 6  
The only link you'll ever need:
http://www.google.com
# 7  
forget telnet use ssh,
the ssh man-pages describes the way
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #142
Difficulty: Easy
Version 4 Unix was rewritten in C in 1977.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to connect to a DB installed on another host using shell script?

Hi Experts There are two hosts say A and B. On host B, Oracle DB is installed and running. I am trying to check if the DB on host B is up and running fine from a script on host A. Is this possible. I tried using commands like sql plus but those doesn't seem to help. Could you please guide. (8 Replies)
Discussion started by: harishshankar
8 Replies

2. Shell Programming and Scripting

Check/get the exit status of a remote command executed on remote host through script

Geeks, Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s). Here's the complete... (5 Replies)
Discussion started by: lovesaikrishna
5 Replies

3. Shell Programming and Scripting

Pause processes in remote host and resume execution in another remote host

Hi, Given addresses of 2 remote machines, using a shell script is it possible to get the state of running processes in "src" stop all the processes in "src" exit out of "src" ssh into "dest" resume the state of executing processes captured in step 1 in "dest" Assumption: "src" is... (3 Replies)
Discussion started by: Saeya Darsan
3 Replies

4. UNIX and Linux Applications

[Solved] How to connect DB2 from UNIX shell script?

Hi all, I have a requirement to connect DB2 database and do some operations and generate a report through shell script. Can anyone please tell me how can i connect DB2 from unix shell script? Thanks in ADV. (2 Replies)
Discussion started by: gani_85
2 Replies

5. Shell Programming and Scripting

Triggering remote UNIX shell script from Remote desktop

I m trying to run a batch script in remote desktop which executes unix commands on the unix server...the problem is i wnt the output in HTML format.so in my batch script i m giving the cmd like ssh hostname path ksh HC_Report.ksh>out.html ...but it generates the HTML file in remote desktop .i... (2 Replies)
Discussion started by: navsan
2 Replies

6. Shell Programming and Scripting

How to run a shell script on a remote host using ftp

Hi, is there a way I can run a shell script through ftp on a remote host? The remote host doesn't have ssh running so I can't use ssh. (7 Replies)
Discussion started by: mrskittles99
7 Replies

7. Shell Programming and Scripting

HTML Code to Run a Script from Remote Unix Host

Hi All, Noticed few posts around this but coudnt get exatcly what i wanted. Thanks for your help again. I have a script running on a remote machine and i normally ssh from putty and run the script manually. Is there anyway that i can write an HTML Code with a button so taht when I Click... (1 Reply)
Discussion started by: robinbannis
1 Replies

8. Shell Programming and Scripting

Executing scipts after logging into a remote host using shell script

Hi All, Sorry if it is a duplicate post. I have not got any reference about this anywhere. I looked at the posts described in SSH - Passing Unix login passwords through shell scripts - Linux / UNIX Forum and it helped me till the point to connect to the host and executing the basic commands.... (3 Replies)
Discussion started by: RSC1985
3 Replies

9. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

10. Shell Programming and Scripting

shell script for how to connect to a remote server by using ssh

i want to connect to a remote server through ssh. i have to also provide password within that script. after connecting to the remote server i want to do some operations like grep,cd etc can u pls help me to wite a script. Thanks (1 Reply)
Discussion started by: millan
1 Replies