Operating System - HP-UX
1825341 Members
4344 Online
109679 Solutions
New Discussion юеВ

Linux, HP-UX rsh based problem

 
Murat SULUHAN
Honored Contributor

Linux, HP-UX rsh based problem

Hi

we are using Linux for SAP Central Instance Application and HP-UX 11.0 and Oracle for SAP Database, we have to run some internal SAP applications for database operations in the SAP GUI, these applications using r* commands, we are using same users in the HP-UX and Linux and ~/.rhosts files as follows

linux's ~/.rhosts
hp-ux orabwp

hp-ux's ~/.rhosts
+ +

The problem is when I wanted to run some SAP specific applications from linux via using SAP GUI and rsh they failed as follows

linux$: rsh hp-ux brtools
sh: brtools: not found.

brtools application is in the user's path

linux$: rlogin hp-ux
hp-ux$: brtools
BR155E No value found for option '-f'
BR377E BRTOOLS call failed

hp-ux$: which brtools
/usr/sap/BWP/SYS/exe/run/brtools

as you can see brtools is in the path and when I use the full path while I'm running rsh, it works;

linux$: rsh hp-ux /usr/sap/BWP/SYS/exe/run/brtools
BR155E No value found for option '-f'
BR377E BRTOOLS call failed

But SAP could not use

rsh

only knows application's name so it have to run with

rsh

I can Unix based commands from Linux as follows

linux$: rsh hp-ux uname -a
HP-UX hp-ux B.11.00 A 9000/800 163434671 two-user license

linux$: rsh hp-ux which uname
/usr/bin/uname

linux$: rsh hp-ux pwd
/oracle/BWP


Any idea?

Best Regards
Murat
Murat Suluhan
17 REPLIES 17
Steven E. Protter
Exalted Contributor

Re: Linux, HP-UX rsh based problem

These protocols can be interfered with as follows:

1) inetd.conf has them commented out.
2) /etc/hosts.equiv is incompatible
3) the .rhosts file uses hostname and dns resolution is down
4) iptables or ipchains firewall is active and blocking on the Linux side.

Check syslog.log on HP and messages file on Linux, it will help in diagnosis.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mark Grant
Honored Contributor

Re: Linux, HP-UX rsh based problem

Are you sure you have


/usr/sap/BWP/SYS/exe/run set in the .profile in the PATH? to be sure run

rsh hp.ux env

Never preceed any demonstration with anything more predictive than "watch this"
Robert-Jan Goossens
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi Murat,

# remsh unix -n brtools

Hope this helps,
Robert-Jan
Stuart Urquhart
Frequent Advisor

Re: Linux, HP-UX rsh based problem

I think the problem is that rsh doesn't source the remote users profile. Try rsh hp-ux "~/.profile; brtools" to force the profile to be sourced.
Massimo Bianchi
Honored Contributor

Re: Linux, HP-UX rsh based problem

Why do not change the OS commands from SM69 ?

Or, give some aliases to the full path nema in the .profile in hp-ux ?

Why do not the name adhere to the sap standard SIDadm / oraSID ??

Massimo
Massimo Bianchi
Honored Contributor

Re: Linux, HP-UX rsh based problem

sorry, evidently i'm missing some coffee....

Massimo

Michael Schulte zur Sur
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi Murat,

this is a typical PATH used by rsh:
/sbin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/local:/dzde/exec

this is the path after rlogin:
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/
opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt
/hparray/bin:/opt/ignite/bin:/dzde/exec:/sbin:/home/root


If your application uses another PATH, you have to run the .profile manually to set it.

greetings,

Michael
Michael Schulte zur Sur
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi Murat,

these examples are from one of our machines and results may vary. However as mentioned by someone before rsh does not run .profile.

greetings,

Michael
Bill Hassell
Honored Contributor

Re: Linux, HP-UX rsh based problem

It's easy to assume that rsh will work like a telnet login but it does not. Just like cron, it runs the command on behalf of the user but forget anything you know about /etc/profile and .profile settings--they will not be sourced. From the remshd man page:

"remshd uses the following path when executing the specified command:/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/contrib/bin:/usr/local/bin"

So something like: rsh hp-ux bdf
will work OK but brtools is not found in the above PATH. But more important: there may be several additional environment variables required to make the brtools program work correctly. Rather than trying to remember everything on the command line, create a shell wrapper script that sets everything as needed, then store the script in /usr/contrib/bin and call it runbrtools or something similar.

Also you wrote:

hp-ux's ~/.rhosts
+ +

Arrrggghhhh!!! That machine is now 100% vulnerable from every machine on your network! NEVER allow + in .rhosts files and certainly never allow + in hosts.equiv. Since you can perform a simple command like rsh hp-ux pwd, then change the hp-ux .rhosts file to contain: cpu_name user_name. And make sure that all .rhosts file have 600 permissions so no one can see the contents except the owner.


Bill Hassell, sysadmin
Murat SULUHAN
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi

re Steven E Protter
I checked your advices, everything is ok and no firewall between hosts

re Mark Grant
/usr/sap/BWP/SYS/exe/run is in the user's profile, (not default /etc/profile) and I think when I use the r* commands the user's profile does not run

re Robert Jan Goosens
I am using Red Hat Enterprise Linux AS 2.1 and
[root#]find / -name remsh
[root#]
so remsh does not exists; I will check from installation CD s

re Stuart Urquhart
linux$: rsh hp-ux "~/.profile; brtools"
sh: /oracle/BWP/.profile: Execute permission denied.
sh: brtools: not found

the user is owner of ~/.profile hp-ux

re Massimo Bianchi
When I saw your first message I was very happy

re Michael Schulte
my idea is true; but I cannot run remote profile before rsh , SAP GUI doesn't let me

re Bill Hassell
first of all, I know + + is very big security hole in unix environments but I'am working on this issue in last 4 hours I am trying everything


re all
I added /usr/sap/BWP/SYS/exe/run directory to path supplied by /etc/profile but I still have same problem

and my hosts.equiv file in hp-ux as follows
+ linux

Thanks for every response

Best Regards
Murat
Murat Suluhan
Michael Schulte zur Sur
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi Murat,

why wouldnt SAP let you?

Have you tried rsh hp-ux ". $HOME/.profile;/usr/sap/BWP/SYS/exe/run/brtools" ?

greetings,

Michael
Murat SULUHAN
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi Michael

in the SAP configuration these variables not editable, only command's parameters editable

Thanks for your response

Best Regards
Murat
The SAP Basis Newbie
Murat Suluhan
Michael Schulte zur Sur
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi Murat,

can you post, what happens in the .profile so that brtools runs and have you tried my proposal?

greetings,

Michael
Murat SULUHAN
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi Michael

your advices works as follows

rsh hp-ux ". $HOME/.profile;/usr/sap/BWP/SYS/exe/run/brtools"
BR155E No value found for option '-f'
BR377E BRTOOLS call failed

Best Regards
Murat
Murat Suluhan
Michael Schulte zur Sur
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi Murat,

how do you start else this tool?
You login and type brtools?
What shell is this use using?

greetings,

Michael
Bill Hassell
Honored Contributor

Re: Linux, HP-UX rsh based problem

.profile is not the complete environment. When you login (using the standard POSIX shell) /etc/profile is run first, followed by .profile so there may be a number of settings in /etc/profile that you are missing. Rather than create a very long line that calls /etc/profile then .profile and finally brtools, create a small script that does the same thing:

#!/usr/bin/sh # (required on line 1)

. /etc/profile
. $HOME/.profile
/usr/sap/BWP/SYS/exe/run/brtools

Save this in a common directory. Make sure there is a dot . and space in front of both profiles (called shell script sourcing). If brtools is a script, trace the results by adding sh -x in front of brtools as in:

sh -x /usr/sap/BWP/SYS/exe/run/brtools

and now you can see the steps and results for each step.


Bill Hassell, sysadmin
Murat SULUHAN
Honored Contributor

Re: Linux, HP-UX rsh based problem

Hi all

I am so sorry for too late response, I was in a training

Michael, I am not start this tool, this is SAP command, and SAP Consultant told me this command runs via rsh, SAP uses /usr/bin/sh

Hi Bill

I applied your advices but not working
thanks for your responses

Best Regards
Murat
Murat Suluhan