remsh doesn't work


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users remsh doesn't work
# 1  
Old 06-16-2009
remsh doesn't work

Hi,

I need to use remsh inside a ksh script. The script would remsh to another machine (maybe different OS) and then execute commands.

A Simple Script:

Code:
#!/usr/bin/ksh

remsh sun7656 -l myuser "cd /user.3/MyFolder; ls -lart"

But this gives me the error:
permission denied

I also tried adding the myuser in .rhosts file, but still then it dosent work. I also added the fully qualified name in .rhosts such as : com.mysite.myuser. Still not working. Any Idea?
# 2  
Old 06-16-2009
Before trying in a script you ought to check on command line, many reasons for remsh to fail...
# 3  
Old 06-16-2009
Can you elaborate some of the reasons?
The command dosent seem to run from command prompt as well.
# 4  
Old 06-16-2009
1) Does the box allow?
Clue: in /etc/inetd.conf:
Code:
#finger      stream tcp nowait bin  /usr/lbin/fingerd  fingerd
login        stream tcp nowait root /usr/lbin/rlogind  rlogind
shell        stream tcp nowait root /usr/lbin/remshd   remshd
exec         stream tcp nowait root /usr/lbin/rexecd   rexecd

2) Are all the hosts in /etc/hosts?

etc...
When you try in command line what does the remote say?
Code:
remsh sun7656

# 5  
Old 06-16-2009
The .rhosts file goes on the target computer in the target user's home directory. The .rhosts file is giving permission for a the named account on the source computer to access the remote account with commands such as "remsh", "rcp" and "rlogin".
That .rhosts file will contain line(s) of the form:
source_computer_name source_user_name
The source_computer_name should be the name (not an alias) returned by "nslookup source_computer_name" when run on the target computer.
A .rhosts file must be owned by root or the owner of the target account.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

-ne 0 doesn't work -le does

Hi, I am using korn shell. until ] do echo "\$# = " $# echo "$1" shift done To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work. Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies

2. Shell Programming and Scripting

How come this if statement doesn't work?

greetings, the following code isn't working as i expect it to. the first dbl brackets do but the second set gets ignored. ie: if i'm on t70c6n229 it echoes "Something" and i expect it not to. what am i missing? if " ]] || " ]]; then echo "Something" fi thanx! (9 Replies)
Discussion started by: crimso
9 Replies

3. UNIX for Dummies Questions & Answers

Why doesn't this work?

find . -name "05_scripts" -type d -exec mv -f {}/'*.aep\ Logs' {}/.LogFiles \; Returns this failure: mv: rename ./019_0120_WS_WH_gate_insideTEST/05_scripts/*.aep\ Logs to ./019_0120_WS_WH_gate_insideTEST/05_scripts/.LogFiles/*.aep\ Logs: No such file or directory I don't know why it's trying... (4 Replies)
Discussion started by: scribling
4 Replies

4. Shell Programming and Scripting

remsh: jar -C option does not work

Hi All, Im trying to extract a file called 'DYEDistinctAppServer.topology' from a jar at specific location data/product/template-topologies, using remsh. command is: remsh $rHost -l $rUser -n 'export JAVA_HOME=/usr/java6_64_SR7; export ORACLE_HOME=/oravl01/oracle/11.1.0.7; export... (4 Replies)
Discussion started by: AB10
4 Replies

5. Shell Programming and Scripting

HELP: If Doesn't Work in AWK

Hi! I have a somehow big file (almost 3000 lines long and thirteen columns). Some lines have no value at all or, at least, are incomplete. The columns' values that have no data are marked with a "-" and the corresponding line (the line that owns that value) should be discarded and not used. ... (5 Replies)
Discussion started by: Marcelo de Brit
5 Replies

6. Shell Programming and Scripting

Awk: Can anyone tell me why this doesn't work?

If there exists a field in stdin, print it, otherwise, print hello..... These print nothing: cat /dev/null | awk '{if ( length > 0 ) print $1; else print "hello"}' cat /dev/null | awk '{if ( $1 ) print $1; else print "hello"}'But the scripts work if I run them directly in a terminal: ... (8 Replies)
Discussion started by: ksheller
8 Replies

7. Shell Programming and Scripting

awk -v -- Why doesn't my example work?

Hi. I've been playing around a bit. This isn't for any practical purpose-- it's really just a theoretical exercise. I wrote this little thing: foreach num ( 6 5 4 ) awk -v "number=$num" 'BEGIN{for(x=0;x<$number;x++) printf "-"; printf "\n"}' end I would expect the following output: ... (3 Replies)
Discussion started by: treesloth
3 Replies

8. Shell Programming and Scripting

ls -d doesn't work on Solaris

Hello, the ls -d command to only list directories in a directory doesn't seem to work on Solaris and the man command says to use that combination: ls -d Anyone have the same problem and find a resolve? Thanks BobK (9 Replies)
Discussion started by: bobk544
9 Replies

9. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

10. Shell Programming and Scripting

Why doesn't this work?

cat .servers | while read LINE; do ssh jason@$LINE $1 done exit 1 ./command.ksh "ls -l ~jason" Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing? Thanks! JP (2 Replies)
Discussion started by: jpeery
2 Replies
Login or Register to Ask a Question