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

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question





















  • 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




    root is superuser. Everybody else can merely become root.
    – muru
    Mar 15 at 14:30














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?










share|improve this question





















  • 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




    root is superuser. Everybody else can merely become root.
    – muru
    Mar 15 at 14:30












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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 15 at 13:32









Limpuls

31




31











  • 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




    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






  • 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










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.






share|improve this answer






















  • 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. 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




    @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






  • 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


















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.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    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






























    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.






    share|improve this answer






















    • 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. 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




      @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






    • 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















    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.






    share|improve this answer






















    • 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. 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




      @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






    • 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













    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.






    share|improve this answer














    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.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    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. 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




      @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






    • 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






    • 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







    • 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 run sudo. 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













    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.






    share|improve this answer
























      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.






      share|improve this answer






















        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 15 at 14:19









        NerdOfLinux

        1,509831




        1,509831



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

            Trouble downloading packages list due to a “Hash sum mismatch” error

            How do I move numbers in filenames, in a batch renaming operation?