execute command on reomte server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting execute command on reomte server
# 1  
Old 12-15-2005
execute command on reomte server

Hi all,
I have to execute one script on remote server. As far as i know we can do FTP to login on to remote server and list down the files. Is there any option to execute any shell secript on the remote server using this or any other remote login.

We have rlogin command also but i am not sure how to pass the user id and password information to this command and execute other script on it. (which on the server different from the server on which i have logged on) .

making it more easier to understand. I have a script on server A. though which i have to execute another script located on server B . Is it possible ?

any help would be highly appreciated.

Thanks
Manish
# 2  
Old 12-15-2005
u can try,

Code:
ssh userid@servername <command_to_execute_in_remoteserver>

or
Code:
rsh <hostname> -l <username> <cmd_to_execute>

but make sure for necessary permissions and public key swapping if u are using ssh
# 3  
Old 12-15-2005
Hi Madhan

Thanks for you quick reply !!!

I am clarifying what i wanted
To run a run a script whch will login to a remote server taking the username and passwd as parameters and will run set of the command there and then logout
# 4  
Old 12-16-2005
if set correctly, matrixmadhan's solution should work unless you are trying a sudo or su action on the remote server ...

if remote account that needs to run the command set on the remote server is the same as the local account, there should be no need to pass a username and password to get what you need done when using ssh/rsh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies

2. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

3. Shell Programming and Scripting

Execute command using ssh server 'cmd'

Hi The command below does not work as it require to take command in the breakers But If I do so the variable values get lost ssh testserver01 'dsmc q b "${ARCHIVE_DIR}*" -sub=yes -querysummary -inactive -fromd="${BACKUP_DATE}"' Thank you. (3 Replies)
Discussion started by: zam
3 Replies

4. Shell Programming and Scripting

How to Execute shell in more than one server?

Hi , I got a shell in one physical server and want to execute it in different servers. I did tried using ssh but iam not successful. Can someone through somelight on the subject and with some working examples ? Also iam trying PHP in the front end to execute the shell and show the logs in... (6 Replies)
Discussion started by: cskumar
6 Replies

5. Shell Programming and Scripting

Shell script to copy a file from one server to anther server and execute the binary

Hi , Is there any script to copy a files (weblogic bianary + silent.xml ) from one server (linux) to another servers and then execute the copy file. We want to copy a file on multiple servers and run the installation. Thanks (1 Reply)
Discussion started by: Nawrajesh
1 Replies

6. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

7. Shell Programming and Scripting

How to execute command in remote server without entering password?

Hi, i want to run the command in remote server through ssh and every time when i run the script its asking to enter the password. I dnt want to enter the password, when i enter the ip address and directly the command shuld execute. Script: #!/bin/bash echo "Enter Server IP Address:" read... (2 Replies)
Discussion started by: bapu1981
2 Replies

8. UNIX for Dummies Questions & Answers

ssh command to execute shell script in another server

ssh -q <hostname> /opt/tcs/satish/tst.ksh ssh -q <anotherserver> /opt/tcs/satish/tst.ksh tst.ksh has "nohup <command> & " when i execute below script , its throwing error as nohup can not be found ssh -q <anotherserver> /opt/tcs/satish/tst.ksh > log & can someone let me... (5 Replies)
Discussion started by: only4satish
5 Replies

9. UNIX for Advanced & Expert Users

execute a script on test server from dev server

I need to execute a script from dev server which is located on Test server.I can use ftp to connect to dev server and from there how can i execute a command on test server. Thanks (5 Replies)
Discussion started by: ukatru
5 Replies

10. UNIX for Dummies Questions & Answers

Plz Help : How to use write command to execute command on some other terminal

Hi Group , I m trying to execute commands on some other system using write command but inspite of executing the commands they r passed as simple messages. - i m writing >write user-id ! ls o ctrl-d inspite of executing the command ls,other terminal shows ! ls. Thnx in advance. (2 Replies)
Discussion started by: Aashish
2 Replies
Login or Register to Ask a Question