How to use sudo with the -i option?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












I am following some tutorial to install Ubuntu with full disk encryption. In it, I am asked to boot the installation media into the live session and perform some operations before installing the distro on my laptop. Some of these operations require a root terminal; alternatively the guide tells me to use sudo -i. However it does not tell me exactly how to use it. For example, in one part says:




You'll want a root terminal for this or use sudo -i.



openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero > /dev/sdxy




I tried reading the man page forsudobut apparently you can use sudo -i with and without a command so I am a bit confused. Specifically I would like to ask:



How to use sudo -i in this setting? Please remember that I will be working in a live session.



Also, any explanation of how the option works is very welcome, but try to keep it as simple as possible since I am a very basic user.










share|improve this question





















  • Why don't you just click on the "encryption" tickbox in the installer? As for your question, you'd better just use sudo -i alone, then you have a root shell you can enter the openssl command.
    – cylgalad
    Sep 15 '16 at 8:10














up vote
0
down vote

favorite
1












I am following some tutorial to install Ubuntu with full disk encryption. In it, I am asked to boot the installation media into the live session and perform some operations before installing the distro on my laptop. Some of these operations require a root terminal; alternatively the guide tells me to use sudo -i. However it does not tell me exactly how to use it. For example, in one part says:




You'll want a root terminal for this or use sudo -i.



openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero > /dev/sdxy




I tried reading the man page forsudobut apparently you can use sudo -i with and without a command so I am a bit confused. Specifically I would like to ask:



How to use sudo -i in this setting? Please remember that I will be working in a live session.



Also, any explanation of how the option works is very welcome, but try to keep it as simple as possible since I am a very basic user.










share|improve this question





















  • Why don't you just click on the "encryption" tickbox in the installer? As for your question, you'd better just use sudo -i alone, then you have a root shell you can enter the openssl command.
    – cylgalad
    Sep 15 '16 at 8:10












up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





I am following some tutorial to install Ubuntu with full disk encryption. In it, I am asked to boot the installation media into the live session and perform some operations before installing the distro on my laptop. Some of these operations require a root terminal; alternatively the guide tells me to use sudo -i. However it does not tell me exactly how to use it. For example, in one part says:




You'll want a root terminal for this or use sudo -i.



openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero > /dev/sdxy




I tried reading the man page forsudobut apparently you can use sudo -i with and without a command so I am a bit confused. Specifically I would like to ask:



How to use sudo -i in this setting? Please remember that I will be working in a live session.



Also, any explanation of how the option works is very welcome, but try to keep it as simple as possible since I am a very basic user.










share|improve this question













I am following some tutorial to install Ubuntu with full disk encryption. In it, I am asked to boot the installation media into the live session and perform some operations before installing the distro on my laptop. Some of these operations require a root terminal; alternatively the guide tells me to use sudo -i. However it does not tell me exactly how to use it. For example, in one part says:




You'll want a root terminal for this or use sudo -i.



openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero > /dev/sdxy




I tried reading the man page forsudobut apparently you can use sudo -i with and without a command so I am a bit confused. Specifically I would like to ask:



How to use sudo -i in this setting? Please remember that I will be working in a live session.



Also, any explanation of how the option works is very welcome, but try to keep it as simple as possible since I am a very basic user.







ubuntu sudo livecd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 15 '16 at 2:54









Garynall96

113




113











  • Why don't you just click on the "encryption" tickbox in the installer? As for your question, you'd better just use sudo -i alone, then you have a root shell you can enter the openssl command.
    – cylgalad
    Sep 15 '16 at 8:10
















  • Why don't you just click on the "encryption" tickbox in the installer? As for your question, you'd better just use sudo -i alone, then you have a root shell you can enter the openssl command.
    – cylgalad
    Sep 15 '16 at 8:10















Why don't you just click on the "encryption" tickbox in the installer? As for your question, you'd better just use sudo -i alone, then you have a root shell you can enter the openssl command.
– cylgalad
Sep 15 '16 at 8:10




Why don't you just click on the "encryption" tickbox in the installer? As for your question, you'd better just use sudo -i alone, then you have a root shell you can enter the openssl command.
– cylgalad
Sep 15 '16 at 8:10










1 Answer
1






active

oldest

votes

















up vote
0
down vote













From man sudo:




-i, --login



Run the shell specified by the target user's password data‐ base
entry as a login shell.




You can get an interactive shell running as root using any of the following methods (these are the full commands just run as is from an existing shell and they will give you a root shell).




  • sudo -i: Gives you a root prompt with a new shell environment (as if root did a login). Does a cd to root's home directory as well.


  • sudo sh or sudo bash: Gives a basic root shell spawned in the environment of the calling user (sanitized by sudo).


  • sudo -s -H: Gives a shell and resets $HOME, but doesn't cd to $HOME like sudo -i.


  • sudo su: Uses the normal su method of becoming root but doesn't need a root password.

Basically I use either sudo -i or sudo -s -H in most cases depending on if I wanted to end up in root's home directory or not.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f309986%2fhow-to-use-sudo-with-the-i-option%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    From man sudo:




    -i, --login



    Run the shell specified by the target user's password data‐ base
    entry as a login shell.




    You can get an interactive shell running as root using any of the following methods (these are the full commands just run as is from an existing shell and they will give you a root shell).




    • sudo -i: Gives you a root prompt with a new shell environment (as if root did a login). Does a cd to root's home directory as well.


    • sudo sh or sudo bash: Gives a basic root shell spawned in the environment of the calling user (sanitized by sudo).


    • sudo -s -H: Gives a shell and resets $HOME, but doesn't cd to $HOME like sudo -i.


    • sudo su: Uses the normal su method of becoming root but doesn't need a root password.

    Basically I use either sudo -i or sudo -s -H in most cases depending on if I wanted to end up in root's home directory or not.






    share|improve this answer
























      up vote
      0
      down vote













      From man sudo:




      -i, --login



      Run the shell specified by the target user's password data‐ base
      entry as a login shell.




      You can get an interactive shell running as root using any of the following methods (these are the full commands just run as is from an existing shell and they will give you a root shell).




      • sudo -i: Gives you a root prompt with a new shell environment (as if root did a login). Does a cd to root's home directory as well.


      • sudo sh or sudo bash: Gives a basic root shell spawned in the environment of the calling user (sanitized by sudo).


      • sudo -s -H: Gives a shell and resets $HOME, but doesn't cd to $HOME like sudo -i.


      • sudo su: Uses the normal su method of becoming root but doesn't need a root password.

      Basically I use either sudo -i or sudo -s -H in most cases depending on if I wanted to end up in root's home directory or not.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        From man sudo:




        -i, --login



        Run the shell specified by the target user's password data‐ base
        entry as a login shell.




        You can get an interactive shell running as root using any of the following methods (these are the full commands just run as is from an existing shell and they will give you a root shell).




        • sudo -i: Gives you a root prompt with a new shell environment (as if root did a login). Does a cd to root's home directory as well.


        • sudo sh or sudo bash: Gives a basic root shell spawned in the environment of the calling user (sanitized by sudo).


        • sudo -s -H: Gives a shell and resets $HOME, but doesn't cd to $HOME like sudo -i.


        • sudo su: Uses the normal su method of becoming root but doesn't need a root password.

        Basically I use either sudo -i or sudo -s -H in most cases depending on if I wanted to end up in root's home directory or not.






        share|improve this answer












        From man sudo:




        -i, --login



        Run the shell specified by the target user's password data‐ base
        entry as a login shell.




        You can get an interactive shell running as root using any of the following methods (these are the full commands just run as is from an existing shell and they will give you a root shell).




        • sudo -i: Gives you a root prompt with a new shell environment (as if root did a login). Does a cd to root's home directory as well.


        • sudo sh or sudo bash: Gives a basic root shell spawned in the environment of the calling user (sanitized by sudo).


        • sudo -s -H: Gives a shell and resets $HOME, but doesn't cd to $HOME like sudo -i.


        • sudo su: Uses the normal su method of becoming root but doesn't need a root password.

        Basically I use either sudo -i or sudo -s -H in most cases depending on if I wanted to end up in root's home directory or not.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 15 '16 at 4:41









        David

        33412




        33412



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f309986%2fhow-to-use-sudo-with-the-i-option%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)