Automated script to SSH to another server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automated script to SSH to another server
# 1  
Old 11-13-2008
Automated script to SSH to another server

Hi guys, I have a script which looks a little like this;

Code:
grep $id /usr/local/production/service/distributor/clients/*/out/events.xml | awk -F/ '{print $8}'

I want to be able to run this on my dev box, so need to add something into the script which will SSH onto the live server, collect the data and print it back to the dev box.

I have tried using;

Code:
shh user@server <<EOF
password
EOF
grep $id /usr/local/production/service/distributor/clients/*/out/events.xml | awk -F/ '{print $8}'

However I cant get it to automate the password entry. Is there anyway of doing so?
JayC89
# 2  
Old 11-13-2008
This has been answered many times in the forum and there are also plenty of Howtos on that subject.
Use the search function of the forum, please. Type in "ssh without password" or something similar and you will get plenty of hits.
# 3  
Old 11-13-2008
Apologies, I should have searched first!
JayC89
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automated script once user send email to UNIX server

is there any possibility to trigger a script. once the user send email to the unix server box with specific subject line. My script will search for the specific word in the unix email and run the shell script if the specific keyword is sent in the email to the unix email box. so that it can... (3 Replies)
Discussion started by: ramkumar15
3 Replies

2. Shell Programming and Scripting

Deleting local server file from automated FTP script

Hi, I want to delete a file on the local server, while connected to remote server through FTP. I am using the below code for this $FTP_CMD -v -n $HOST <<*! >> $LOGFILE 2>&1 user $USER $PASSWORD cd $DIR ... (11 Replies)
Discussion started by: jhilmil
11 Replies

3. Shell Programming and Scripting

Script to ssh to remote server

Hi All, I need to prepare a script. Description: Currently i am in server "x(ubuntu os)", here i need to develop a script to ssh to another server "y(ubuntu os)", i have password less authentication to "y". i have done the below #!/bin/bash #ssh to the server "y" and confirming i am... (2 Replies)
Discussion started by: kumar85shiv
2 Replies

4. Shell Programming and Scripting

Connect (SSH) to Windows server via Linux server through a script and passing command.. but failing

I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd" i am trying in this manner " ssh username@servername "cd... (5 Replies)
Discussion started by: sunil seelam
5 Replies

5. Shell Programming and Scripting

Script to SSH into a server

Hi, Actually i'm trying to write a script which needs to ssh into a server and run a command on the server, after entering a valid login. But after ssh the script will no longer run on the SSHed server :( so is there any way to do so ??? (1 Reply)
Discussion started by: nagios
1 Replies

6. Programming

Not able to ssh to other server from CGI script

Hi All, I have designed a web tool in perl cgi in UNIX Solaris 10 platform. According to my cgi script (in server A) it should execute a script (in server B) using ssh key authentication, but it is not. And when I am trying to execute the command without cgi script, the script in server B... (4 Replies)
Discussion started by: ankit_talwar
4 Replies

7. Shell Programming and Scripting

Automated script to look for files in FTP Server location.

suppose one file comes in one sever location on MOnday.we have to write a script to automatically get that files and put it in different server location. ---------- Post updated at 10:28 AM ---------- Previous update was at 10:27 AM ---------- Please help me on this (2 Replies)
Discussion started by: sonam273
2 Replies

8. Shell Programming and Scripting

automated ssh with provision for passphrase

Below is a part of my shell script. Currently I have shared the public key of the client with the host, therefore I will not be prompted for the password. The key that has been created on the client is also without a passphrase. If it is created with a passphrase, the code I have will not... (3 Replies)
Discussion started by: farahzaiba
3 Replies

9. Shell Programming and Scripting

Automated ssh to multiple boxes

I have a script that will ssh to several different servers, perform a command, display the output, and exit. It works well, but I have to enter my password for each server. That gets a little cumbersome when you have a couple dozen servers. Anyone out there know how to automate this so that I only... (2 Replies)
Discussion started by: fedexer
2 Replies

10. Shell Programming and Scripting

Script to ssh to different server and get some info

Hi Friends, i am trying to write a script on server MACHINE1 to ssh to server MACHINE2 and fetch some information. i am using the following command: ChanCount=`ssh MACHINE2 "disp card all | grep Inserv | grep -v STATE | wc -l"` The "disp" command works well on MACHINE2 but not working... (2 Replies)
Discussion started by: am_yadav
2 Replies
Login or Register to Ask a Question