Do super user still need to have execute permission for directory to enter it?

Clash Royale CLAN TAG#URR8PPP up vote
0
down vote
favorite
I used my super user hoping that I will be able to do everything with it, but to access one directory, I still had to do sudo su command to switch to root because I was getting access denied. Then how come super user is super user and still canâÂÂt access directory? And if I was switching to root, why sudo su didn't ask for password for root user and it worked without or with super user password which wasn't allowed to execute dir?
permissions sudo directory root
add a comment |Â
up vote
0
down vote
favorite
I used my super user hoping that I will be able to do everything with it, but to access one directory, I still had to do sudo su command to switch to root because I was getting access denied. Then how come super user is super user and still canâÂÂt access directory? And if I was switching to root, why sudo su didn't ask for password for root user and it worked without or with super user password which wasn't allowed to execute dir?
permissions sudo directory root
Mypathlldbashscript will help you answer this question. See github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"
â waltinator
Mar 15 at 13:43
2
root is superuser. Everybody else can merely become root.
â muru
Mar 15 at 14:30
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I used my super user hoping that I will be able to do everything with it, but to access one directory, I still had to do sudo su command to switch to root because I was getting access denied. Then how come super user is super user and still canâÂÂt access directory? And if I was switching to root, why sudo su didn't ask for password for root user and it worked without or with super user password which wasn't allowed to execute dir?
permissions sudo directory root
I used my super user hoping that I will be able to do everything with it, but to access one directory, I still had to do sudo su command to switch to root because I was getting access denied. Then how come super user is super user and still canâÂÂt access directory? And if I was switching to root, why sudo su didn't ask for password for root user and it worked without or with super user password which wasn't allowed to execute dir?
permissions sudo directory root
permissions sudo directory root
asked Mar 15 at 13:32
Limpuls
31
31
Mypathlldbashscript will help you answer this question. See github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"
â waltinator
Mar 15 at 13:43
2
root is superuser. Everybody else can merely become root.
â muru
Mar 15 at 14:30
add a comment |Â
Mypathlldbashscript will help you answer this question. See github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"
â waltinator
Mar 15 at 13:43
2
root is superuser. Everybody else can merely become root.
â muru
Mar 15 at 14:30
My
pathlld bash script will help you answer this question. See github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"â waltinator
Mar 15 at 13:43
My
pathlld bash script will help you answer this question. See github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"â waltinator
Mar 15 at 13:43
2
2
root is superuser. Everybody else can merely become root.
â muru
Mar 15 at 14:30
root is superuser. Everybody else can merely become root.
â muru
Mar 15 at 14:30
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
Superuser and root are synonyms. Your user is probably a sudoer, not a superuser.
In Ubuntu, you can perform a single command as root using the sudo command. Or you can open a rootâÂÂs shell using sudo su, sudo -s or sudo -i. (I wonâÂÂt discuss the differences here. Also, plain su could be used â if you knew the rootâÂÂs password.)
sudo cd makes no sense since it would change the directory and then drop to your shell which might not be able to open the directory. Therefore Ubuntu disallows it completely:
$ sudo cd /root
sudo: cd: command not found
However, we can issue:
$ sudo ls -l /root
total 0
So how can we cd to the directory? We have to use a root shell:
$ sudo su
root@my-ubuntu:/home/mirek# cd /root
root@my-ubuntu:~# ls -l
total 0
You asked why you havenâÂÂt to input password in this case. ItâÂÂs because you have used sudo recently. To force it to need the password again, you can issue sudo -k. Otherwise, it starts to require the password after a few minutes again.
Thanks for clear explanation. But then why do I need to use sudo in the first place if I already am super user? I mean I logged in with super user called âÂÂdeveloperâ which has SU privilegies.
â Limpuls
Mar 15 at 14:41
1
@Limpuls you are not the super user.developeris not the super user. Only root is.developercan become the superuser, i.e.,rootusingsu(orsudo).
â muru
Mar 15 at 14:42
1
@Limpuls - see help.ubuntu.com/community/RootSudo
â Panther
Mar 15 at 14:44
@Limpuls Adding to what muru said, your developer user is a sudoer, i.e. a user allowed to runsudo. Only root should be called a superuser.
â Melebius
Mar 15 at 14:45
1
@Melebius Okay now I understand. So when we give privilegies to user and make him sudoer, he is allowed to use sudo command. Meaning that simple users by default canâÂÂt usd sudo command?
â Limpuls
Mar 15 at 21:45
 |Â
show 1 more comment
up vote
0
down vote
You can't run the cd command with sudo or else you will get errors. You must run:
sudo su
or
sudo -s
to get into a root shell before using cd as root.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Superuser and root are synonyms. Your user is probably a sudoer, not a superuser.
In Ubuntu, you can perform a single command as root using the sudo command. Or you can open a rootâÂÂs shell using sudo su, sudo -s or sudo -i. (I wonâÂÂt discuss the differences here. Also, plain su could be used â if you knew the rootâÂÂs password.)
sudo cd makes no sense since it would change the directory and then drop to your shell which might not be able to open the directory. Therefore Ubuntu disallows it completely:
$ sudo cd /root
sudo: cd: command not found
However, we can issue:
$ sudo ls -l /root
total 0
So how can we cd to the directory? We have to use a root shell:
$ sudo su
root@my-ubuntu:/home/mirek# cd /root
root@my-ubuntu:~# ls -l
total 0
You asked why you havenâÂÂt to input password in this case. ItâÂÂs because you have used sudo recently. To force it to need the password again, you can issue sudo -k. Otherwise, it starts to require the password after a few minutes again.
Thanks for clear explanation. But then why do I need to use sudo in the first place if I already am super user? I mean I logged in with super user called âÂÂdeveloperâ which has SU privilegies.
â Limpuls
Mar 15 at 14:41
1
@Limpuls you are not the super user.developeris not the super user. Only root is.developercan become the superuser, i.e.,rootusingsu(orsudo).
â muru
Mar 15 at 14:42
1
@Limpuls - see help.ubuntu.com/community/RootSudo
â Panther
Mar 15 at 14:44
@Limpuls Adding to what muru said, your developer user is a sudoer, i.e. a user allowed to runsudo. Only root should be called a superuser.
â Melebius
Mar 15 at 14:45
1
@Melebius Okay now I understand. So when we give privilegies to user and make him sudoer, he is allowed to use sudo command. Meaning that simple users by default canâÂÂt usd sudo command?
â Limpuls
Mar 15 at 21:45
 |Â
show 1 more comment
up vote
2
down vote
accepted
Superuser and root are synonyms. Your user is probably a sudoer, not a superuser.
In Ubuntu, you can perform a single command as root using the sudo command. Or you can open a rootâÂÂs shell using sudo su, sudo -s or sudo -i. (I wonâÂÂt discuss the differences here. Also, plain su could be used â if you knew the rootâÂÂs password.)
sudo cd makes no sense since it would change the directory and then drop to your shell which might not be able to open the directory. Therefore Ubuntu disallows it completely:
$ sudo cd /root
sudo: cd: command not found
However, we can issue:
$ sudo ls -l /root
total 0
So how can we cd to the directory? We have to use a root shell:
$ sudo su
root@my-ubuntu:/home/mirek# cd /root
root@my-ubuntu:~# ls -l
total 0
You asked why you havenâÂÂt to input password in this case. ItâÂÂs because you have used sudo recently. To force it to need the password again, you can issue sudo -k. Otherwise, it starts to require the password after a few minutes again.
Thanks for clear explanation. But then why do I need to use sudo in the first place if I already am super user? I mean I logged in with super user called âÂÂdeveloperâ which has SU privilegies.
â Limpuls
Mar 15 at 14:41
1
@Limpuls you are not the super user.developeris not the super user. Only root is.developercan become the superuser, i.e.,rootusingsu(orsudo).
â muru
Mar 15 at 14:42
1
@Limpuls - see help.ubuntu.com/community/RootSudo
â Panther
Mar 15 at 14:44
@Limpuls Adding to what muru said, your developer user is a sudoer, i.e. a user allowed to runsudo. Only root should be called a superuser.
â Melebius
Mar 15 at 14:45
1
@Melebius Okay now I understand. So when we give privilegies to user and make him sudoer, he is allowed to use sudo command. Meaning that simple users by default canâÂÂt usd sudo command?
â Limpuls
Mar 15 at 21:45
 |Â
show 1 more comment
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Superuser and root are synonyms. Your user is probably a sudoer, not a superuser.
In Ubuntu, you can perform a single command as root using the sudo command. Or you can open a rootâÂÂs shell using sudo su, sudo -s or sudo -i. (I wonâÂÂt discuss the differences here. Also, plain su could be used â if you knew the rootâÂÂs password.)
sudo cd makes no sense since it would change the directory and then drop to your shell which might not be able to open the directory. Therefore Ubuntu disallows it completely:
$ sudo cd /root
sudo: cd: command not found
However, we can issue:
$ sudo ls -l /root
total 0
So how can we cd to the directory? We have to use a root shell:
$ sudo su
root@my-ubuntu:/home/mirek# cd /root
root@my-ubuntu:~# ls -l
total 0
You asked why you havenâÂÂt to input password in this case. ItâÂÂs because you have used sudo recently. To force it to need the password again, you can issue sudo -k. Otherwise, it starts to require the password after a few minutes again.
Superuser and root are synonyms. Your user is probably a sudoer, not a superuser.
In Ubuntu, you can perform a single command as root using the sudo command. Or you can open a rootâÂÂs shell using sudo su, sudo -s or sudo -i. (I wonâÂÂt discuss the differences here. Also, plain su could be used â if you knew the rootâÂÂs password.)
sudo cd makes no sense since it would change the directory and then drop to your shell which might not be able to open the directory. Therefore Ubuntu disallows it completely:
$ sudo cd /root
sudo: cd: command not found
However, we can issue:
$ sudo ls -l /root
total 0
So how can we cd to the directory? We have to use a root shell:
$ sudo su
root@my-ubuntu:/home/mirek# cd /root
root@my-ubuntu:~# ls -l
total 0
You asked why you havenâÂÂt to input password in this case. ItâÂÂs because you have used sudo recently. To force it to need the password again, you can issue sudo -k. Otherwise, it starts to require the password after a few minutes again.
edited Mar 15 at 14:48
answered Mar 15 at 14:33
Melebius
3,81341636
3,81341636
Thanks for clear explanation. But then why do I need to use sudo in the first place if I already am super user? I mean I logged in with super user called âÂÂdeveloperâ which has SU privilegies.
â Limpuls
Mar 15 at 14:41
1
@Limpuls you are not the super user.developeris not the super user. Only root is.developercan become the superuser, i.e.,rootusingsu(orsudo).
â muru
Mar 15 at 14:42
1
@Limpuls - see help.ubuntu.com/community/RootSudo
â Panther
Mar 15 at 14:44
@Limpuls Adding to what muru said, your developer user is a sudoer, i.e. a user allowed to runsudo. Only root should be called a superuser.
â Melebius
Mar 15 at 14:45
1
@Melebius Okay now I understand. So when we give privilegies to user and make him sudoer, he is allowed to use sudo command. Meaning that simple users by default canâÂÂt usd sudo command?
â Limpuls
Mar 15 at 21:45
 |Â
show 1 more comment
Thanks for clear explanation. But then why do I need to use sudo in the first place if I already am super user? I mean I logged in with super user called âÂÂdeveloperâ which has SU privilegies.
â Limpuls
Mar 15 at 14:41
1
@Limpuls you are not the super user.developeris not the super user. Only root is.developercan become the superuser, i.e.,rootusingsu(orsudo).
â muru
Mar 15 at 14:42
1
@Limpuls - see help.ubuntu.com/community/RootSudo
â Panther
Mar 15 at 14:44
@Limpuls Adding to what muru said, your developer user is a sudoer, i.e. a user allowed to runsudo. Only root should be called a superuser.
â Melebius
Mar 15 at 14:45
1
@Melebius Okay now I understand. So when we give privilegies to user and make him sudoer, he is allowed to use sudo command. Meaning that simple users by default canâÂÂt usd sudo command?
â Limpuls
Mar 15 at 21:45
Thanks for clear explanation. But then why do I need to use sudo in the first place if I already am super user? I mean I logged in with super user called âÂÂdeveloperâ which has SU privilegies.
â Limpuls
Mar 15 at 14:41
Thanks for clear explanation. But then why do I need to use sudo in the first place if I already am super user? I mean I logged in with super user called âÂÂdeveloperâ which has SU privilegies.
â Limpuls
Mar 15 at 14:41
1
1
@Limpuls you are not the super user.
developer is not the super user. Only root is. developer can become the superuser, i.e., root using su (or sudo).â muru
Mar 15 at 14:42
@Limpuls you are not the super user.
developer is not the super user. Only root is. developer can become the superuser, i.e., root using su (or sudo).â muru
Mar 15 at 14:42
1
1
@Limpuls - see help.ubuntu.com/community/RootSudo
â Panther
Mar 15 at 14:44
@Limpuls - see help.ubuntu.com/community/RootSudo
â Panther
Mar 15 at 14:44
@Limpuls Adding to what muru said, your developer user is a sudoer, i.e. a user allowed to run
sudo. Only root should be called a superuser.â Melebius
Mar 15 at 14:45
@Limpuls Adding to what muru said, your developer user is a sudoer, i.e. a user allowed to run
sudo. Only root should be called a superuser.â Melebius
Mar 15 at 14:45
1
1
@Melebius Okay now I understand. So when we give privilegies to user and make him sudoer, he is allowed to use sudo command. Meaning that simple users by default canâÂÂt usd sudo command?
â Limpuls
Mar 15 at 21:45
@Melebius Okay now I understand. So when we give privilegies to user and make him sudoer, he is allowed to use sudo command. Meaning that simple users by default canâÂÂt usd sudo command?
â Limpuls
Mar 15 at 21:45
 |Â
show 1 more comment
up vote
0
down vote
You can't run the cd command with sudo or else you will get errors. You must run:
sudo su
or
sudo -s
to get into a root shell before using cd as root.
add a comment |Â
up vote
0
down vote
You can't run the cd command with sudo or else you will get errors. You must run:
sudo su
or
sudo -s
to get into a root shell before using cd as root.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You can't run the cd command with sudo or else you will get errors. You must run:
sudo su
or
sudo -s
to get into a root shell before using cd as root.
You can't run the cd command with sudo or else you will get errors. You must run:
sudo su
or
sudo -s
to get into a root shell before using cd as root.
answered Mar 15 at 14:19
NerdOfLinux
1,509831
1,509831
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1015185%2fdo-super-user-still-need-to-have-execute-permission-for-directory-to-enter-it%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
My
pathlldbashscript will help you answer this question. See github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"â waltinator
Mar 15 at 13:43
2
root is superuser. Everybody else can merely become root.
â muru
Mar 15 at 14:30