oh my zsh for the root and for all user












10















I have installed zsh and I am using Oh My ZSH plugins. Everything works fine, but when I become a root user, it changes to the default zsh theme.



What should I do to make the Oh My ZSH configuration as the default zsh for all users including root?



I have tried using the chsh -s /bin/zsh root



That gave me zsh but not oh_my_zsh



I also tried cp -R /home/user/.zshrc /root/.zshrcing to get oh_my_zsh for root, but nothing worked.



(I don't need zsh but I need oh_my_zsh for all the user in the system)










share|improve this question

























  • How are you becoming root?

    – frlan
    Sep 8 '14 at 12:01






  • 1





    How did you install oh my zsh in the first place? Any why not just do the same for root?

    – Adaephon
    Sep 8 '14 at 12:26






  • 1





    I think cFINNY's answer on stackoverflow.com/a/42193058/1408600 is what you need. I've done that for months on servers i managed. It works for root and all users

    – ayik
    Jan 2 at 2:57
















10















I have installed zsh and I am using Oh My ZSH plugins. Everything works fine, but when I become a root user, it changes to the default zsh theme.



What should I do to make the Oh My ZSH configuration as the default zsh for all users including root?



I have tried using the chsh -s /bin/zsh root



That gave me zsh but not oh_my_zsh



I also tried cp -R /home/user/.zshrc /root/.zshrcing to get oh_my_zsh for root, but nothing worked.



(I don't need zsh but I need oh_my_zsh for all the user in the system)










share|improve this question

























  • How are you becoming root?

    – frlan
    Sep 8 '14 at 12:01






  • 1





    How did you install oh my zsh in the first place? Any why not just do the same for root?

    – Adaephon
    Sep 8 '14 at 12:26






  • 1





    I think cFINNY's answer on stackoverflow.com/a/42193058/1408600 is what you need. I've done that for months on servers i managed. It works for root and all users

    – ayik
    Jan 2 at 2:57














10












10








10


2






I have installed zsh and I am using Oh My ZSH plugins. Everything works fine, but when I become a root user, it changes to the default zsh theme.



What should I do to make the Oh My ZSH configuration as the default zsh for all users including root?



I have tried using the chsh -s /bin/zsh root



That gave me zsh but not oh_my_zsh



I also tried cp -R /home/user/.zshrc /root/.zshrcing to get oh_my_zsh for root, but nothing worked.



(I don't need zsh but I need oh_my_zsh for all the user in the system)










share|improve this question
















I have installed zsh and I am using Oh My ZSH plugins. Everything works fine, but when I become a root user, it changes to the default zsh theme.



What should I do to make the Oh My ZSH configuration as the default zsh for all users including root?



I have tried using the chsh -s /bin/zsh root



That gave me zsh but not oh_my_zsh



I also tried cp -R /home/user/.zshrc /root/.zshrcing to get oh_my_zsh for root, but nothing worked.



(I don't need zsh but I need oh_my_zsh for all the user in the system)







zsh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 30 '17 at 19:57









sh2p

6510




6510










asked Sep 8 '14 at 10:41









DhanviDhanvi

6033928




6033928













  • How are you becoming root?

    – frlan
    Sep 8 '14 at 12:01






  • 1





    How did you install oh my zsh in the first place? Any why not just do the same for root?

    – Adaephon
    Sep 8 '14 at 12:26






  • 1





    I think cFINNY's answer on stackoverflow.com/a/42193058/1408600 is what you need. I've done that for months on servers i managed. It works for root and all users

    – ayik
    Jan 2 at 2:57



















  • How are you becoming root?

    – frlan
    Sep 8 '14 at 12:01






  • 1





    How did you install oh my zsh in the first place? Any why not just do the same for root?

    – Adaephon
    Sep 8 '14 at 12:26






  • 1





    I think cFINNY's answer on stackoverflow.com/a/42193058/1408600 is what you need. I've done that for months on servers i managed. It works for root and all users

    – ayik
    Jan 2 at 2:57

















How are you becoming root?

– frlan
Sep 8 '14 at 12:01





How are you becoming root?

– frlan
Sep 8 '14 at 12:01




1




1





How did you install oh my zsh in the first place? Any why not just do the same for root?

– Adaephon
Sep 8 '14 at 12:26





How did you install oh my zsh in the first place? Any why not just do the same for root?

– Adaephon
Sep 8 '14 at 12:26




1




1





I think cFINNY's answer on stackoverflow.com/a/42193058/1408600 is what you need. I've done that for months on servers i managed. It works for root and all users

– ayik
Jan 2 at 2:57





I think cFINNY's answer on stackoverflow.com/a/42193058/1408600 is what you need. I've done that for months on servers i managed. It works for root and all users

– ayik
Jan 2 at 2:57










3 Answers
3






active

oldest

votes


















19














I made symbolic links to my zsh files in my home dir, that seems to work fine:



ln -s $HOME/.oh-my-zsh           /root/.oh-my-zsh
ln -s $HOME/.zshrc /root/.zshrc





share|improve this answer





















  • 2





    This should be the accepted answer, eliminates the hustle of installing zsh twice.

    – daumie
    Aug 17 '16 at 10:11






  • 1





    If you do that, it actually doesn't make sense to link .oh-my-zsh, because the .zshrc still references the .oh-my-zsh of your original user.

    – Jam Risser
    Mar 3 '17 at 8:14






  • 1





    Didn't work for me when trying to link from non-root to root, ended up installing it for the non-root as well

    – Akash Agarwal
    Apr 7 '17 at 13:55








  • 2





    I tried it and could not use oh-my-zsh plugins using this method. They were considered insecure by compinit.

    – Melebius
    Jul 18 '17 at 8:48






  • 4





    I recommend against this method, at least if one does not first consider the security risks. Any program the user runs can edit those configuration files without prompting the user--because they belong to the user, not root--and thus can cause root to perform any action whatsoever next time root uses zsh! Would you be willing to add (or okay with someone else adding) a warning about that to this answer?

    – Eliah Kagan
    Jul 30 '17 at 20:29



















7














Just run the install command as root user (after doing sudo su)



sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"





share|improve this answer

































    1














    I installed oh-my-zsh with root account. Now I login with another account, and install oh-my-zsh again in the home directory of the account. It works for the non-root account.






    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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      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%2f521469%2foh-my-zsh-for-the-root-and-for-all-user%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      19














      I made symbolic links to my zsh files in my home dir, that seems to work fine:



      ln -s $HOME/.oh-my-zsh           /root/.oh-my-zsh
      ln -s $HOME/.zshrc /root/.zshrc





      share|improve this answer





















      • 2





        This should be the accepted answer, eliminates the hustle of installing zsh twice.

        – daumie
        Aug 17 '16 at 10:11






      • 1





        If you do that, it actually doesn't make sense to link .oh-my-zsh, because the .zshrc still references the .oh-my-zsh of your original user.

        – Jam Risser
        Mar 3 '17 at 8:14






      • 1





        Didn't work for me when trying to link from non-root to root, ended up installing it for the non-root as well

        – Akash Agarwal
        Apr 7 '17 at 13:55








      • 2





        I tried it and could not use oh-my-zsh plugins using this method. They were considered insecure by compinit.

        – Melebius
        Jul 18 '17 at 8:48






      • 4





        I recommend against this method, at least if one does not first consider the security risks. Any program the user runs can edit those configuration files without prompting the user--because they belong to the user, not root--and thus can cause root to perform any action whatsoever next time root uses zsh! Would you be willing to add (or okay with someone else adding) a warning about that to this answer?

        – Eliah Kagan
        Jul 30 '17 at 20:29
















      19














      I made symbolic links to my zsh files in my home dir, that seems to work fine:



      ln -s $HOME/.oh-my-zsh           /root/.oh-my-zsh
      ln -s $HOME/.zshrc /root/.zshrc





      share|improve this answer





















      • 2





        This should be the accepted answer, eliminates the hustle of installing zsh twice.

        – daumie
        Aug 17 '16 at 10:11






      • 1





        If you do that, it actually doesn't make sense to link .oh-my-zsh, because the .zshrc still references the .oh-my-zsh of your original user.

        – Jam Risser
        Mar 3 '17 at 8:14






      • 1





        Didn't work for me when trying to link from non-root to root, ended up installing it for the non-root as well

        – Akash Agarwal
        Apr 7 '17 at 13:55








      • 2





        I tried it and could not use oh-my-zsh plugins using this method. They were considered insecure by compinit.

        – Melebius
        Jul 18 '17 at 8:48






      • 4





        I recommend against this method, at least if one does not first consider the security risks. Any program the user runs can edit those configuration files without prompting the user--because they belong to the user, not root--and thus can cause root to perform any action whatsoever next time root uses zsh! Would you be willing to add (or okay with someone else adding) a warning about that to this answer?

        – Eliah Kagan
        Jul 30 '17 at 20:29














      19












      19








      19







      I made symbolic links to my zsh files in my home dir, that seems to work fine:



      ln -s $HOME/.oh-my-zsh           /root/.oh-my-zsh
      ln -s $HOME/.zshrc /root/.zshrc





      share|improve this answer















      I made symbolic links to my zsh files in my home dir, that seems to work fine:



      ln -s $HOME/.oh-my-zsh           /root/.oh-my-zsh
      ln -s $HOME/.zshrc /root/.zshrc






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 16 '17 at 6:39









      Community

      1




      1










      answered Dec 9 '15 at 9:13









      MortenMorten

      3741312




      3741312








      • 2





        This should be the accepted answer, eliminates the hustle of installing zsh twice.

        – daumie
        Aug 17 '16 at 10:11






      • 1





        If you do that, it actually doesn't make sense to link .oh-my-zsh, because the .zshrc still references the .oh-my-zsh of your original user.

        – Jam Risser
        Mar 3 '17 at 8:14






      • 1





        Didn't work for me when trying to link from non-root to root, ended up installing it for the non-root as well

        – Akash Agarwal
        Apr 7 '17 at 13:55








      • 2





        I tried it and could not use oh-my-zsh plugins using this method. They were considered insecure by compinit.

        – Melebius
        Jul 18 '17 at 8:48






      • 4





        I recommend against this method, at least if one does not first consider the security risks. Any program the user runs can edit those configuration files without prompting the user--because they belong to the user, not root--and thus can cause root to perform any action whatsoever next time root uses zsh! Would you be willing to add (or okay with someone else adding) a warning about that to this answer?

        – Eliah Kagan
        Jul 30 '17 at 20:29














      • 2





        This should be the accepted answer, eliminates the hustle of installing zsh twice.

        – daumie
        Aug 17 '16 at 10:11






      • 1





        If you do that, it actually doesn't make sense to link .oh-my-zsh, because the .zshrc still references the .oh-my-zsh of your original user.

        – Jam Risser
        Mar 3 '17 at 8:14






      • 1





        Didn't work for me when trying to link from non-root to root, ended up installing it for the non-root as well

        – Akash Agarwal
        Apr 7 '17 at 13:55








      • 2





        I tried it and could not use oh-my-zsh plugins using this method. They were considered insecure by compinit.

        – Melebius
        Jul 18 '17 at 8:48






      • 4





        I recommend against this method, at least if one does not first consider the security risks. Any program the user runs can edit those configuration files without prompting the user--because they belong to the user, not root--and thus can cause root to perform any action whatsoever next time root uses zsh! Would you be willing to add (or okay with someone else adding) a warning about that to this answer?

        – Eliah Kagan
        Jul 30 '17 at 20:29








      2




      2





      This should be the accepted answer, eliminates the hustle of installing zsh twice.

      – daumie
      Aug 17 '16 at 10:11





      This should be the accepted answer, eliminates the hustle of installing zsh twice.

      – daumie
      Aug 17 '16 at 10:11




      1




      1





      If you do that, it actually doesn't make sense to link .oh-my-zsh, because the .zshrc still references the .oh-my-zsh of your original user.

      – Jam Risser
      Mar 3 '17 at 8:14





      If you do that, it actually doesn't make sense to link .oh-my-zsh, because the .zshrc still references the .oh-my-zsh of your original user.

      – Jam Risser
      Mar 3 '17 at 8:14




      1




      1





      Didn't work for me when trying to link from non-root to root, ended up installing it for the non-root as well

      – Akash Agarwal
      Apr 7 '17 at 13:55







      Didn't work for me when trying to link from non-root to root, ended up installing it for the non-root as well

      – Akash Agarwal
      Apr 7 '17 at 13:55






      2




      2





      I tried it and could not use oh-my-zsh plugins using this method. They were considered insecure by compinit.

      – Melebius
      Jul 18 '17 at 8:48





      I tried it and could not use oh-my-zsh plugins using this method. They were considered insecure by compinit.

      – Melebius
      Jul 18 '17 at 8:48




      4




      4





      I recommend against this method, at least if one does not first consider the security risks. Any program the user runs can edit those configuration files without prompting the user--because they belong to the user, not root--and thus can cause root to perform any action whatsoever next time root uses zsh! Would you be willing to add (or okay with someone else adding) a warning about that to this answer?

      – Eliah Kagan
      Jul 30 '17 at 20:29





      I recommend against this method, at least if one does not first consider the security risks. Any program the user runs can edit those configuration files without prompting the user--because they belong to the user, not root--and thus can cause root to perform any action whatsoever next time root uses zsh! Would you be willing to add (or okay with someone else adding) a warning about that to this answer?

      – Eliah Kagan
      Jul 30 '17 at 20:29













      7














      Just run the install command as root user (after doing sudo su)



      sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"





      share|improve this answer






























        7














        Just run the install command as root user (after doing sudo su)



        sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"





        share|improve this answer




























          7












          7








          7







          Just run the install command as root user (after doing sudo su)



          sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"





          share|improve this answer















          Just run the install command as root user (after doing sudo su)



          sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 16 '17 at 7:19









          muru

          1




          1










          answered Sep 8 '14 at 12:41









          DhanviDhanvi

          6033928




          6033928























              1














              I installed oh-my-zsh with root account. Now I login with another account, and install oh-my-zsh again in the home directory of the account. It works for the non-root account.






              share|improve this answer




























                1














                I installed oh-my-zsh with root account. Now I login with another account, and install oh-my-zsh again in the home directory of the account. It works for the non-root account.






                share|improve this answer


























                  1












                  1








                  1







                  I installed oh-my-zsh with root account. Now I login with another account, and install oh-my-zsh again in the home directory of the account. It works for the non-root account.






                  share|improve this answer













                  I installed oh-my-zsh with root account. Now I login with another account, and install oh-my-zsh again in the home directory of the account. It works for the non-root account.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 16 '15 at 2:37









                  HenryHenry

                  1263




                  1263






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f521469%2foh-my-zsh-for-the-root-and-for-all-user%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                       ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕