Sending Commands to a Remote Host


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sending Commands to a Remote Host
# 1  
Old 08-17-2007
Power Sending Commands to a Remote Host

I am trying to write a script that logs into an SMTP server and authenticates as a user or verifies that a user exists. I can do all this from the command line but I don't know how to write a script to do this for me, I login and then the script stops, I'm sure this is some basic principle. Thanks tons, please point me in the correct direction.
# 2  
Old 08-17-2007
Have you tried searching the forums? Here is a link to a search I did. It may give you some clues.
https://www.unix.com/search.php?searchid=167491
# 3  
Old 08-17-2007
I had to dig a little deeper than I thought I might. This article was useful:
https://www.unix.com/unix-for-dummies...-a-script.html
I'm using this script to diagnose POP, SMTP, and email receipt problems. All of the commands i give the SMTP or POP server are lost invisible to me (sure they are there in the code) I want to see the response of the server and parse that to get my results? how would I do that? Also is there a better way than:
Code:
(sleep 1
echo 'user'
sleep 1
echo 'pass'
echo 'etc') | telnet pop.wherever.com 110

This seems sloppy, sleep seems like the wrong command here?
Thanks tons
# 4  
Old 08-18-2007
hi
the language "expect" is designed to do such things
Expect - Expect - Home Page
mfg guenter
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

3. Shell Programming and Scripting

Login to remote host and execute commands

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)
Discussion started by: amru8810
3 Replies

4. UNIX for Dummies Questions & Answers

Sending commands to a remote server

Hi I have managed to connect to a remote server via ssh, but nothing will actually send through to the remote server screen through my script...it waits until i am back to the main terminal before it outputs anything. Can anyone tell me how to get commands to send through to the remote server?... (4 Replies)
Discussion started by: Hopper_no1
4 Replies

5. UNIX for Advanced & Expert Users

Help! How to find the local host after few ssh hops to remote host???

I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1. When I do a who -m from A2, I see the "connected from" as "A1". => who -m userid pts/2 2010-03-27 08:47 (A1) I want to identify who is the local host who initiated the connection to... (3 Replies)
Discussion started by: gomes1333
3 Replies

6. Shell Programming and Scripting

running commands to remote host from centralized host

Gurus/Experts We have a centralized UNIX/Solaris server from where we can actually ssh to all other UNIX/Solaris servers...I need to write a script that reside on this centerlized server and do FileSystem monitoring (basically run df -h or -k) of other remote servers and then send an email to me... (6 Replies)
Discussion started by: anjum.suri
6 Replies

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

8. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

9. Solaris

How to delete the files from local host to remote host

Hi all, i am copying .gz files from production server to development server using "scp" command.my requirement is after copying .gz files i want to delete old .gz files(two days back) in development server from production server. like this way i need to delelte .log ,.z and .dmp files... (3 Replies)
Discussion started by: krishna176
3 Replies

10. UNIX for Dummies Questions & Answers

Sending tar output to a remote host

Our group has recently inherited 15 servers that have not been maintained for over a year. My first action is to backup the units however there is not enough disk space on most of them to run tar. My supervisor said to look at piping the tar output to another machine, however I have been unable... (3 Replies)
Discussion started by: thumper
3 Replies
Login or Register to Ask a Question