Re: sudo cd... command not found?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Keith Smith via PLUG-discuss
Date:  
To: Dale Farnsworth
CC: techlists, Main PLUG discussion list
New-Topics: sudo -1 vs sudo (was Re: sudo cd... command not found?)
Subject: Re: sudo cd... command not found?
Thanks Dale,

Worked!! Thanks!!

I noticed it made me the root user.

What is the difference between sudo -i and sudo su?

In my research it appears that both change to user to root along with
changing the UID. I've been using sudo -i to solver this issue for
years while not fully understanding it.

I assume sudo elevates the user's permissions however they stay that
user and their UID does not change??

Keith


On 2022-12-21 21:47, Dale Farnsworth wrote:
> [I sent this message yesterday, not sure why it didn't make the list.
> Re-sending]
>
> sudo only runs commands found in $PATH.
> cd is a built-in shell command, therefore sudo can't find it.
> The fix is to do su or "sudo su" to get a root shell, and then in the
> root shell do a cd to the restricted directory.
>
> Dale
>
> On Tue, Dec 20, 2022 at 6:27 PM Keith Smith via PLUG-discuss
> <> wrote:
>
>> Hi,
>>
>> Not sure what is going on here:
>>
>> cd <path> results in message "-bash: cd: <path> : Permission
>> denied".
>>
>> Then I add sudo : sudo cd <path> results in message : "sudo: cd:
>> command not found".
>>
>> Any help is much appreciated!!
>>
>> Keith
>> ---------------------------------------------------
>> PLUG-discuss mailing list:
>> To subscribe, unsubscribe, or to change your mail settings:
>> https://lists.phxlinux.org/mailman/listinfo/plug-discuss

---------------------------------------------------
PLUG-discuss mailing list:
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss