execute remote commands with rsh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting execute remote commands with rsh
# 1  
Old 02-23-2011
execute remote commands with rsh

Hi,

I earlier determined I cannot use FTP to execute remote commands on a server.

My problem, I need to use a second server to get/put files via ftp onto my primary server and various tertiary servers.

my server(A) ---> server (B) ----> server blah(c), server balh(C)

I cannot directly ftp to server C from A due to network restrictions.

Can anyone let me know how to use / script rsh commands?

I have simple tried without success, command is a script I ahve written
Code:
rsh user@ipaddrservB command

EDIT - I guess it isn't connecting to the host - i know my ip is right?

Last edited by mcclunyboy; 02-23-2011 at 06:46 AM..
# 2  
Old 02-23-2011
Code:
rsh -l username hostname /bin/sh <your-script.sh

Replace /bin/sh with whatever shell is appropriate for hostname

For automatic execution without password, you'd have to setup .rhosts or hosts.equiv. But you may have to pass an option the daemon side to allow such things (as they are commonly considered to be insecure).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Nim server "Unable to execute remote client commands"

Hello, What is its mean? Could you please help me? Best regards, root@nimserver:/> nimadm -j nimadmvg -c dev4 -s spot1 -l lpp_source1 -d "hdisk7" -Y Initializing the NIM master. Initializing NIM client dev4. 0042-006 c_rsh: (exec_nimsh_cmd) exec_cmd Error 0 poll: setup failure... (2 Replies)
Discussion started by: getrue
2 Replies

2. Shell Programming and Scripting

How to execute commands on remote server using expect script?

I need to copy python script file to around 100 servers using expect script. 1. Copy script to my user home first(/home/myhome) on each remote server 2. change permissions on copied file to 766. 3. sudo to appuser1 account on remote server. copy script file from my user home to /usr/bin/... (1 Reply)
Discussion started by: kchinnam
1 Replies

3. How to Post in the The UNIX and Linux Forums

Simultaneously try to execute commands after connecting to remote account to one account

I have made password less connection to my remote account. and i tried to execute commands at a time. but i am unable to execute the commands. ssh $ACCOUNT_DETAILS@$HOST_DETAILS cd ~/JEE/*/logs/ (1 Reply)
Discussion started by: kishored005
1 Replies

4. Shell Programming and Scripting

Shell script help to execute ssh remote commands

Hi, The below command is not giving me the count , Can somebody help me in re-writing this pls . Proc_Exist=`ssh -q -o "BatchMode=yes" -o "PasswordAuthentication=no" $OAUSER@${Primary_Node} ps -ef | grep -v grep | grep "${ICM_Proc}" |wc -l ` Also the same problem with below... (13 Replies)
Discussion started by: Y.balakrishna
13 Replies

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

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

7. Solaris

Unable to execute commands using rsh in Solaris 9 and 10.

Unable to execute commands using rsh in Solaris 9 and 10. When I execute this command " rsh -n 172.16.67.91 ls -l " I am getting this error message. ::ffff:172.16.67.91: Connection refused Please guide me how to enable rsh. Thanks & Regards Durgaprasad (1 Reply)
Discussion started by: durgaprasadr13
1 Replies

8. UNIX for Advanced & Expert Users

Remote commands problem using RSH & Rexec

I have enabled the RSH and Rexec command in my HP-UX server but when i try to send any command to the server it returns Execute Permission Denied except commands like ls-l C:\rsh xxx.xxx.xxx.xxx -l mpac mxpkill 12 the mxpkill command work when I log to the server using telnet with the same... (0 Replies)
Discussion started by: fhuwaidy
0 Replies

9. Shell Programming and Scripting

RSH and sending commands

Dear All, I want to rsh a machine; lets say rsh ds-00 then i want to send a couple of commands via a script to be perfomed on the remote computer for instance rsh ds-00 df -k but it is not working when i do the scripting... What can be the problem BR/asad (1 Reply)
Discussion started by: asadlone
1 Replies

10. Shell Programming and Scripting

rsh help with remote prompts

Hi, I'm writing a shell script that rsh's onto a remote machine and runs a perl script that requires values to be entered as the script executes. I also need to ba able to see the outputs from the perl script. When I try to run it I get an stty : Invalid argument and understand that this is... (4 Replies)
Discussion started by: ianf
4 Replies
Login or Register to Ask a Question