- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- remsh and running certain commands .. PATH ??
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2000 07:54 AM
тАО11-17-2000 07:54 AM
I would get ioscan not found. But when I went and added the "PATH=/usr/bin;/usr/sbin;ioscan
-kfnC " It works. My question is where in the remote box is it set what PATH you have when you log in though remote shell? The reson I think there is a setting is because doing a ping command : remsh boxname "ping 000.000.00.000" it works .. running the same command to a differnt box it does not work unless I add
remsh boxname2 "PATH=/usr/bin;/usr/sbin;ping 000.000.00.000" then it works. This leads me to think that there is something differnt between the 2 boxes. Anyone have any advice?
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2000 08:03 AM
тАО11-17-2000 08:03 AM
Solution/usr/bin:/usr/ccs/bin:/usr/bin/X11:
the following command line sets up the environment for the remote command before
executing the remote command:
remsh otherhost . .profile 2>&- \; command
(extracted from man remsh)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2000 08:15 AM
тАО11-17-2000 08:15 AM
Re: remsh and running certain commands .. PATH ??
Just my 2 cents.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2000 08:52 AM
тАО11-17-2000 08:52 AM
Re: remsh and running certain commands .. PATH ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2000 09:39 AM
тАО11-17-2000 09:39 AM
Re: remsh and running certain commands .. PATH ??
Part of unix security 101 is that you should always endeavor to execute a command with its full path ie. /usr/sbin/ioscan
the reason is that a malacious user could place a substitute ioscan command on the first directory of the path and get their version of ioscan to do some nasty stuff.
Bottom line, modify your scripts to specify the full path to the command. A shortcut is to define the variable
IOSCAN="/usr/sbin/ioscan"
and use:
$IOSCAN -fnC disk
etc.
My 2 cents.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-19-2000 11:47 PM
тАО11-19-2000 11:47 PM
Re: remsh and running certain commands .. PATH ??
I totally agree with Kofi. You should, for security reasons, always use fully qualified program names when running remote commands.
if your remote program needs special environment variables (i.e. PATH) why don't you encapsulate it within a script. It would be easier as you won't have to bother with those variables anymore.
My 2 cents...
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2000 01:16 AM
тАО11-20-2000 01:16 AM
Re: remsh and running certain commands .. PATH ??
you check that with remsh
All settings from .profile will be executed by remsh before command is taken
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2000 07:13 AM
тАО11-20-2000 07:13 AM
Re: remsh and running certain commands .. PATH ??
If you were security conciense, you would run the command on the local box, and mail the results to the admin box.
It is best still to do 1 of 2 things mentioned. 1 specify the path in your script.
PATH="/usr/sbin:/sbin:/sbin:/etc:/bin"
This would mean you are probably running what you want to run.
If you have doubts, set your commands to variables. I do this in mixed OS environments. and for portability of scripts.
case `uname` in
HP-UX)
XTERM='/usr/bin/X11/xterm'
PING='/etc/ping'
;;
SunOS )
XTERM='/usr/openwin/bin/xterm'
PING='/usr/bin/ping'
;;
esac
You get the Idea I think.
Hope it helps.
Shannon