Link to home
Create AccountLog in
Avatar of aixtutorial
aixtutorialFlag for United States of America

asked on

Enable rsh from AIX to RHEL Linux

Enable rsh from AIX to RHEL Linux..I want to execute a script on linux server from AIX through rsh..please provide all the steps
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

1) Add the hostname of the AIX machine to the ~/.rhosts file on Linux in the home directory of the target user (the one under whose credentials you're planning to run the script).

If the file doesn't exist create it with permissions 600 and add one fully qualified hostname per line. For security reasons you can also add the source userid following the hostname, e.g.

aix-host.domain.tld   aixtutorial

2) On Linux, edit /etc/xinetd.d/rsh to change "disable    yes" to "disable     no" if required.
If the file (etc/xinetd.d/rsh doesn't exist create it like this:

     service shell
      {
            socket_type             = stream
            wait                    = no
            user                    = root
            server                  = /usr/sbin/in.rshd
            disable                 = no
      }


3) If you created or changed the file run

service xinetd restart

Run a first test from AIX with

rsh linux_host -l linux_user hostname

Remember that linux_user is the one on Linux under whose credentials you're planning to run your script, and whose .rhosts file you changed or created.

4) If the above runss successfully by displaying the hostname of your Linux box you're ready to run your script:

rsh linux_host -l linux_user /path/to/script
RSH=`which ssh` your-rsh-using-oracle-command
Avatar of Gns
Gns

Of course, woolmillpork is correct.... As is gheist. Yes, you can very well enable rsh for the systems to work, it is pretty much the same as enabling it on any system, but it is not really necessary, since both aix and linux can accomodate SSH, which is better in most regards (you spend a small amount of bandwidth for security).
If you need the ssh interraction to be scriptable, you'd need do one of three possible things:
1) use an agent to provide the keys, or
2) create a set of keys with no password and use those for crosswise connection, or
3) use a scripting tool like expect to provide logon credentials (provided teh systems allow keyboard password logon via SSH), and thus overcome the need for ratty ol' rsh:-).

Of the three approaches, #2 is the easiest to setup/use. Google is your friend here, but basically it is as simple as in this article: http://www.linuxproblem.org/art_9.html
If your AIX ssytem lack SSH, it is easily installable from your install media, if nowhere else, the "AIX toolbox for linux" (which actually is the other way round:-) should have it, or get it from bulls freeware site.

But as said: As stated in the question, the first answer is as good as it gets;-).

Cheers
--
-- Glenn
Oracle supports it the way i mentioned, all guides say otherwise.
Why open insecurity? "for system to work"
Avatar of aixtutorial

ASKER

Woolmilkproc,

I have made all the confirguration above

I am getting this error:

linux_host: Connection refused
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
I am getting the beloe error:

/sbin/service --status-all | grep shell
capi not installed - No such file or directory (2)
Device not specified in /etc/sysconfig/diskdump
Server address not specified in /etc/sysconfig/netdump



telnet linux_host 514
Trying...
telnet: connect: Connection refused
/etc/init.d/xinetd status
xinetd (pid 19310) is running...

Please let me know as what needs to be done to make it work
Please perform all the checks I suggested and let me know their results!
Do you run a local firewall on the linux host? If so,m you need open up for rsh to work.

Easiest way to check/set this is by running "setup" in a terminal, then choose firewall configuration (arrow keys and possibly <TAB> to navigate, <Enter> to choose...). First screen will show if the firewall is active. If it is, you can choose "modify" (I use a Swedish locale, so the actual strings might differ a bit:). The RSH service isn't available on the first screen of the modify action, so just choose next and there chose to add "514/udp 514/tcp". Now choose "Close" and "Exit" you way out. It'll ask you if you want to restart/actiavte the canges.

But easier still is to use SSH;-).

Cheers
--
-- Glenn