use of ssh in scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting use of ssh in scripts
# 1  
Old 11-16-2005
use of ssh in scripts

Hi all..

My problem is i have some commands, some run in my linux machine, and the rest in another linux machine.
I have to ssh to that machine..

how can i ssh with username and password in shell scripts..
can i use commands like

Quote:
ssh -l root 192.168.2.3 -p password
thanks in advance
# 2  
Old 11-16-2005
you want to run commands on remote machine r something else.

then u can use
rsh -l username host "command1;command2;so on"

Last edited by Raom; 11-16-2005 at 02:07 AM..
# 3  
Old 11-16-2005
Thanks for the quick reply

I need to enter into the shell of the second machine, and do some commands..
is there any way other that rsh..
pls help..

also let me know how can i specify the password for rsh login

Last edited by esham; 11-16-2005 at 02:18 AM..
# 4  
Old 11-16-2005
setup keys on the remote machine
# 5  
Old 11-16-2005
Please explain what is "setup keys"...
iam not aware of setup keys..
# 6  
Old 11-16-2005
# 7  
Old 11-16-2005
But here i need to setup the ssh server as below
Quote:
You need to install the following packages to the SSH server machine:

* openssh
* openssh-server
i cannot do any installation in the remote machine..
but i have validate username..

is there any way to login to that machine in my script..

pls help
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Linux startup and stop scripts using SSH

I have a question. Actually I want to make two scripts, one is startup.sh and other is stopscript.sh so for example, I have 5 servers. Each server has two instances :- abc111 - Masters -cra4 abc222 -middle tear -cra abc333 -middle tear -cra1 abc444 -middle tear ... (1 Reply)
Discussion started by: siddharthjain
1 Replies

2. Shell Programming and Scripting

Bash scripts - CGI and ssh

Hi Everyone, I started looking at the possibility of making some of our bash scripts available through a web server using CGI and the simple ones works just fine. Now I need to execute remote commands using ssh but can't really get it to work. I got private keys all sorted. Must be ssh... (1 Reply)
Discussion started by: arizah
1 Replies

3. Shell Programming and Scripting

Starting Scripts Using SSH

Hi all, Case 1: ./Myscript.sh param (on a first node) Another node: (In parallel i run the same script) ./Myscript.sh param (on a second node) Case2: From my host, using ssh: for i in $(seq $nb_lignes) (0 Replies)
Discussion started by: chercheur111
0 Replies

4. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

5. Shell Programming and Scripting

SSH - Passing Unix login passwords through shell scripts

Hi All , I need to call a script runscript_B.sh on server A, the runscript_B.sh script locating in server B. The runscript_B.sh in calls another script runscript_A on server A itself. it seend, i need to be connect from Server A to Server B using ssh. I have tryed like this in... (3 Replies)
Discussion started by: koti_rama
3 Replies

6. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

7. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

8. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies

9. HP-UX

ssh scripts

hi, I need a script for transport a compressed files using ssh ( /oracle/JDD/oraarch.stanby filesytem ) in local server. and remote server also decompress these files and excute also in remote. (0 Replies)
Discussion started by: abozgul
0 Replies

10. Shell Programming and Scripting

scripts in another linux m/c via ssh

I want to write a script which connects to another linux via ssh. now i need to execute the rest of my script in that linux.. the echo is coming only when i exited from 10.1.1.252.. pls help (4 Replies)
Discussion started by: esham
4 Replies
Login or Register to Ask a Question