Deutsch   English   Français   Italiano  
<vml04v$2ugq2$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Wayne <wayne@nospam.invalid>
Newsgroups: comp.unix.shell
Subject: Re: Default PATH setting - reduce to something more sensible?
Date: Mon, 20 Jan 2025 03:05:52 -0500
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <vml04v$2ugq2$1@dont-email.me>
References: <vm5dei$2c7to$1@dont-email.me> <vm5qc7$ft9$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 20 Jan 2025 09:05:52 +0100 (CET)
Injection-Info: dont-email.me; posting-host="43c57b03217ccd8af5bdb5cbe91d7cbd";
	logging-data="3097410"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+zvbo2AH2bZcGbbl1NfDMFOQGxHChQeds="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:O4LyFLv8NXEEjePYq3J6cbNc5co=
Content-Language: en-US
In-Reply-To: <vm5qc7$ft9$1@reader2.panix.com>
Bytes: 1786

On 1/14/2025 8:55 AM, Dan Cross wrote:
> ... It seems to me that, as a normal user, the PATH
>> (and with it the path-search) could be drastically reduced. Is there
>> a method to only have them in the PATH when 'sudo'ing any programs
>> that require root privileges and the privileged programs in 'sbin'?
> 
> Yes, `sudo` can be configured to set $PATH for the programs that
> it invokes; see sudoers(5) and look for `secure_path`.  If you
> don't invoke those from your normal shell, I don't see a problem
> removing them from the default.

As for non-sudo PATH, you can always run:
     export PATH=$(getconf PATH)
To get a minimal PATH setting guaranteed to include all POSIX
utilities.

-- 
Wayne