Operating System - HP-UX
1822474 Members
2550 Online
109642 Solutions
New Discussion юеВ

Re: how to setup commands from /bin to run for all

 
SOLVED
Go to solution
Mark Vollmers
Esteemed Contributor

how to setup commands from /bin to run for all

Hi, all. This is a very simple question, but I just can't seem to think of what it should be, and I figured that it would be easier to ask as opposed to smashing by computer to small bits (not really in the mood to screw around too much...Deep breaths...) Anyway...

I have some commands for a few of our apps, and there are links put in /bin/. When I am root, I can type the command anywhere, and it will work. If I am logged in as myself, I can't type it in (even in /bin); it says not found. If everyone has read access to /bin, how do I setup so that I can use the commands in it as a normal user. I figure something goes in my .profile, but can't think of what. Thanks, all!

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
9 REPLIES 9
Sanjay_6
Honored Contributor
Solution

Re: how to setup commands from /bin to run for all

hi Mark,

Though everyone will not be able to use the commands in /bin, but still you can add it to their search path. Edit /etc/profile and add this line,

export PATH=$PATH:/bin

This will add /bin to the path of all the users and then can access the commands. Not sure they would be able to execute them too. You need root access to execute most of the commands in this directory.

Hope this helps.

regds
harry d brown jr
Honored Contributor

Re: how to setup commands from /bin to run for all

Is /bin linked to /usr/bin?

the permissions should be 555 on the directory.
and if the PATH variable does have /bin or /sbin, then add it to /etc/profile.

live free or die
harry
Live Free or Die
Helen French
Honored Contributor

Re: how to setup commands from /bin to run for all

Hi,

Two things to check up,

1) Set PATH in /etc/profile ( global profile )
eg: PATH=$PATH:/bin
export PATH

2) Permissions of /bin - should be 'r-x' for 'others'


HTH,
Shiju
Life is a promise, fulfill it!
Patrick Wallek
Honored Contributor

Re: how to setup commands from /bin to run for all

/bin is actually a link to /usr/bin. Just add /usr/bin to everyones path. If they are using /usr/bin/sh (posix shell) as their shell then /usr/bin SHOULD already be in their path. If not you can modify /etc/profile or /etc/PATH and add it in.

If they are using a shell other than /usr/bin/sh then you will need to modify to appropriate file(s) for that shell.
Mark Vollmers
Esteemed Contributor

Re: how to setup commands from /bin to run for all

Thanks, all. Seems that everything was setup correctly, but the problem is that the command works when I am logged into the server (the app is on the server) but evidently the link is bad on the workstation, and it doesn't want to create a link to the file that is on a different file system. but at least it should work correctly if I can get the file in the right spots. Thanks.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
James R. Ferguson
Acclaimed Contributor

Re: how to setup commands from /bin to run for all

Hi Mark:

You should avoid using /bin and /lib. These, among others, are "transition" links initially provided with the advent of 10.x when the HP-UX filesystem layout changed from 9.x and earlier and was modeled after AT&T SVR4 and OSF/1.

If you do an 'ls -l' at the root level, you will see something like:

lr-xr-xr-t 1 root sys 8 Aug 20 1997 bin -> /usr/bin

lr-xr-xr-t 1 root sys 8 Aug 20 1997 lib -> /usr/lib

The 't' denotes a transition link and as the name implies is provided for some indefinite period while you "transition" your software to reference the new directories.

If the links are lost, you can recover all of them by running this:

# /opt/upgrade/bin/tlinstall -v

There are man pages available and are worth reading.

Regards!

...JRF...
Mark Vollmers
Esteemed Contributor

Re: how to setup commands from /bin to run for all

Thanks, James! I had noted the t in the listing, and wondered about it. I think that I had been putting new links in /bin when I installed programs, so I'll be sure to use /usr/bin from now on. One of those little things that's out there but no one tells until you ask. Thanks again.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Eric Ladner
Trusted Contributor

Re: how to setup commands from /bin to run for all

Another thing to check..

Since you can run it as root and not as yourself, it smacks of a permissions problem.

Say the command is X, so under /usr/bin you have a soft link X -> /some/other/location/X.

Check the permissions on each level of /some/other/location to make sure that non root users can even see the directory, and that X is executable by everyone.

ls -ld /some /some/other /some/other/location /some/other/location/X

All of the directories and the file should be at least r-xr-xr-x for everybody to be able to execute X.
MAD_2
Super Advisor

Re: how to setup commands from /bin to run for all

I would just like to add one word of caution, that is to limit those users who have access to the specific command(s) and provide the access right (mode changes) only to those commands you want them to have access to for a specific purpose.

You don't want to run into the problem of giving users permissions to some commands that should be only used by the super user. You can face a real administrive dilemma later on if things go wrong.

I mean, we all like to automate and make sure users can do things on their own, after all that's one of our main goals as administrators, to automate as much as possible. However, sometimes by trying to make things too easy on ourselves we end up with headaches that put us in a spot when burning some midnight oil is necessary.
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with