Bash can't find a file that ls can (newbie)

Bash can't find a file that ls can (newbie)

Post by Charlie Burrow » Tue, 20 Apr 1999 04:00:00



I'm trying to get out of the habit of logging in as root but when I login as
charlie (a user I created) I can't get at a whole load of files (see subject
line). The main irritation is that I can't run any of the programs in sbin
despite the fact that the programs and the directory have permissions (and
ownership etc.) exactly the same as the bin directory with which I have no
problems. I would have thought this is a permissions problem but I can't see
how.
    I hope I'm missing something really obvious (but not so obvious that I
look stupid!)
If I haven't given enough info please mail me as I would *really* like to
get to the bottom of this.

Cheers.
Charlie.

 
 
 

Bash can't find a file that ls can (newbie)

Post by Alan J. Wyli » Tue, 20 Apr 1999 04:00:00



> I'm trying to get out of the habit of logging in as root but when I login as
> charlie (a user I created) I can't get at a whole load of files (see subject
> line). The main irritation is that I can't run any of the programs in sbin
> despite the fact that the programs and the directory have permissions (and
> ownership etc.) exactly the same as the bin directory with which I have no
> problems. I would have thought this is a permissions problem but I can't see
> how.
>     I hope I'm missing something really obvious (but not so obvious that I
> look stupid!)

'fraid so :-)

Check the environment variable PATH for the two users:
charlie's will look something like:
$ echo $PATH                                                                  
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/qt/bin

and root's will have /sbin and /usr/sbin in it, but possibly
not /usr/local/bin.

Check the .profile and .bash_profile for the users, and also /etc/profile
(hint - files starting with "." are usually not shown by "ls" - try "ls -a"

if you were to give the full path name, e.g.

$ /usr/sbin/traceroute www.linux.com

that would work as well.

Quote:> If I haven't given enough info please mail me as I would *really* like to
> get to the bottom of this.

> Cheers.
> Charlie.


 
 
 

Bash can't find a file that ls can (newbie)

Post by Kevi » Wed, 21 Apr 1999 04:00:00


I just thought I'd check this...did you try placing a ./ in front of
the command if you're in the directory?

Ex: if you're in bin directory

./command

Like Alan said, if it's not in your path, that's what you'll have to
do.

Kevin

On Mon, 19 Apr 1999 21:10:28 GMT, "Charlie Burrows"


>I'm trying to get out of the habit of logging in as root but when I login as
>charlie (a user I created) I can't get at a whole load of files (see subject
>line). The main irritation is that I can't run any of the programs in sbin
>despite the fact that the programs and the directory have permissions (and
>ownership etc.) exactly the same as the bin directory with which I have no
>problems. I would have thought this is a permissions problem but I can't see
>how.
>    I hope I'm missing something really obvious (but not so obvious that I
>look stupid!)
>If I haven't given enough info please mail me as I would *really* like to
>get to the bottom of this.

>Cheers.
>Charlie.

 
 
 

Bash can't find a file that ls can (newbie)

Post by gus » Wed, 21 Apr 1999 04:00:00


As an aside, and in addition to what the other posters say ... you
should not really need to run any of the programs in /sbin unless you
are logged in as root anyway.

It is a security issue.

When you need to run an administrative program, then log in as root.

gus


> I'm trying to get out of the habit of logging in as root but when I login as
> charlie (a user I created) I can't get at a whole load of files (see subject
> line). The main irritation is that I can't run any of the programs in sbin
> despite the fact that the programs and the directory have permissions (and
> ownership etc.) exactly the same as the bin directory with which I have no
> problems. I would have thought this is a permissions problem but I can't see
> how.
>     I hope I'm missing something really obvious (but not so obvious that I
> look stupid!)
> If I haven't given enough info please mail me as I would *really* like to
> get to the bottom of this.

> Cheers.
> Charlie.