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

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How can my unix shell script automatically connect to remote host?
# 1  
Old 11-15-2002
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'.




# 2  
Old 11-15-2002
This smacks of a homework question, and what's more this:

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  
Old 11-18-2002
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  
Old 11-25-2002
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  
Old 11-25-2002
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 )

# 6  
Old 11-26-2002
The only link you'll ever need:
# 7  
Old 05-16-2006
forget telnet use ssh,
the ssh man-pages describes the way
Login or Register to Ask a Question

Previous Thread | Next Thread

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. 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 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. Shell Programming and Scripting

how will i connect postgres database from unix shell script

I have got the solution so just closing this issue. (3 Replies)
Discussion started by: jambesh
3 Replies
Login or Register to Ask a Question