From ollym@onetel.net.uk Fri May 4 09:10:05 2001 From: Oliver Maunder To: users@lists.opensuse.org Subject: Root cannot Date: Fri, 04 May 2001 10:08:03 +0100 Message-ID: <96247550468.20010504100803@bigfoot.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6842010403336684114==" --===============6842010403336684114== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi all I'm fairly new to Linux, and I've come across a strange problem. Sometimes, when I try to run a script as root, bash says it can't find the command. Here's an example: root@linux:/usr/local/Freenet > ls -l total 720 -rw-r--r-- 1 root root 18007 Apr 27 22:50 COPYING -rw-r--r-- 1 root root 1363 Apr 27 22:50 Changelog -rw-r--r-- 1 root root 7209 Apr 27 22:50 README -rw-r--r-- 1 root root 668190 Apr 27 22:50 freenet.jar -rwxr-xr-x 1 root root 513 Apr 27 22:50 freenet_config -rwxr-xr-x 1 root root 525 Apr 27 22:50 freenet_insert -rwxr-xr-x 1 root root 528 Apr 27 22:50 freenet_request -rwxr-xr-x 1 root root 505 Apr 27 22:50 freenet_server -rw-r--r-- 1 root root 7365 Apr 27 22:50 mime.types -rw-r--r-- 1 root root 5749 Apr 27 22:50 sample.freenetrc root@linux:/usr/local/Freenet > freenet_server bash: freenet_server: command not found Root owns the file, and it's executable, so what's the problem? I can run this script from my user account. Is bash trying to stop me being stupid and running potentially dangerous scripts as root? Thanks for your help Olly --===============6842010403336684114==-- From grimmer@suse.de Fri May 4 09:43:22 2001 From: Lenz Grimmer To: users@lists.opensuse.org Subject: Re: [SLE] Root cannot Date: Fri, 04 May 2001 11:43:21 +0200 Message-ID: In-Reply-To: <96247550468.20010504100803@bigfoot.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0234792266436245316==" --===============0234792266436245316== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, 4 May 2001, Oliver Maunder wrote: > I'm fairly new to Linux, and I've come across a strange problem. > Sometimes, when I try to run a script as root, bash says it can't find > the command. > > Here's an example: > > root@linux:/usr/local/Freenet > ls -l > total 720 > -rw-r--r-- 1 root root 18007 Apr 27 22:50 COPYING > -rw-r--r-- 1 root root 1363 Apr 27 22:50 Changelog > -rw-r--r-- 1 root root 7209 Apr 27 22:50 README > -rw-r--r-- 1 root root 668190 Apr 27 22:50 freenet.jar > -rwxr-xr-x 1 root root 513 Apr 27 22:50 freenet_config > -rwxr-xr-x 1 root root 525 Apr 27 22:50 freenet_insert > -rwxr-xr-x 1 root root 528 Apr 27 22:50 freenet_request > -rwxr-xr-x 1 root root 505 Apr 27 22:50 freenet_server > -rw-r--r-- 1 root root 7365 Apr 27 22:50 mime.types > -rw-r--r-- 1 root root 5749 Apr 27 22:50 sample.freenetrc > root@linux:/usr/local/Freenet > freenet_server > bash: freenet_server: command not found > > Root owns the file, and it's executable, so what's the problem? I can > run this script from my user account. Is bash trying to stop me being > stupid and running potentially dangerous scripts as root? Well, kind of. The root user's PATH environment variable does not contain the current directory for security reasons (Imagine someone places a nasty script named "ls" in a publicly writable directory like /tmp, that executes "rm -rf /" when called - this is fatal, if you have root permissions.). If you want to execute a command or script in the local directory, call it like this "./