I tried it out and am frankly baffled.
Let us say I am NOT root, and I have a directory mydir.
cd mydir and it works fine (mydir has the same privileges like me,
since I own it).
sudo cd mydir and I get "sudo: cd: command not found" (after I give
root password).
OKay.. Now I do a su (and give the root password when asked).
Now do cd mydir and it works fine. Let my say that my default
privilege for all files/directories is 755.
I can't explain why this happens. Can some guru explain what is happening ?
Many thanks,
partha
There was an innocent query about sudo in this list. (Never mind why
you want to do a sudo cd)
I tried it out and am frankly baffled.
Let us say I am NOT root, and I have a directory mydir.
cd mydir and it works fine (mydir has the same privileges like me,
since I own it).
sudo cd mydir and I get "sudo: cd: command not found" (after I give
root password).
OKay.. Now I do a su (and give the root password when asked).
Now do cd mydir and it works fine. Let my say that my default
privilege for all files/directories is 755.
I can't explain why this happens. Can some guru explain what is happening ?
Many thanks,
partha
--
LUG@IITD - http://tinyurl.com/ycueutm
Correct. Also, there is a list of commands that can be run by certain
users and not ALL commands can be run. This is maintained through a
sudoers file. See "man sudoers". A brief overview from the manpage
follows -
"NAME
sudoers - list of which users may execute what
DESCRIPTION
The sudoers file is composed of two types of entries: aliases
(basically variables) and user specifications (which specify who may
run what).
When multiple entries match for a user, they are applied in
order. Where there are multiple matches, the last match is used
(which is not necessarily the most
specific match)."
Your distro may allow any sudoer to run any command but "cd" still
will not work since it is not an executable binary.
Sharad