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:
#!/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?
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.