I want to
/var/named but it gives me a permission denied error, and when I want to use
sudo to do this I am not permitted. What is the technical reason for this, and is it possible to do this some other way?
Ubuntu – Why doesn’t `sudo cd /var/named` work?
I want to
The reason you can't do this is simple and two fold
cdis not a program but an in-built command and
sudoonly applies to programs.
sudo foomeans run the program foo as root
sudo cd /pathreturns
cdis not a program.
If it were possible to use sudo to
cdto a protected directory then having run the command
sudo cd /var/namedyou would be in that directory as a normal user but normal users are not allowed to be in that directory.
This is not possible.
You can use
sudo -ito elevate yourself to super user. For example:
You are now logged on as root and can use whatever commands you wish. When finished type
exitand you are back to being logged on as a normal user.