Failed to login after setting fish as default shell












1















I tried fish for a while, and then i wanted to set it as my default shell. I edited /etc/passwd and changed the shell of my user to /bin/fish.



The problem is I couldn't login anymore. I tried through my DM (SDDM), it said the login failed at any password I threw at it, correct or wrong. Then I tried it through a tty, got the same results. Replacing fish with the shell I had before in my passwd file seemed to fix this.



Is there any way to set fish as the default shell and still be able to login?



I am running Manjaro Linux.










share|improve this question




















  • 1





    Your primary mistake was editing /etc/passd by hand. Had you used the appropriate command to change your login shell (e.g., chsh) it would/should have warned you about the problem.

    – Kurtis Rader
    Jan 18 at 5:42
















1















I tried fish for a while, and then i wanted to set it as my default shell. I edited /etc/passwd and changed the shell of my user to /bin/fish.



The problem is I couldn't login anymore. I tried through my DM (SDDM), it said the login failed at any password I threw at it, correct or wrong. Then I tried it through a tty, got the same results. Replacing fish with the shell I had before in my passwd file seemed to fix this.



Is there any way to set fish as the default shell and still be able to login?



I am running Manjaro Linux.










share|improve this question




















  • 1





    Your primary mistake was editing /etc/passd by hand. Had you used the appropriate command to change your login shell (e.g., chsh) it would/should have warned you about the problem.

    – Kurtis Rader
    Jan 18 at 5:42














1












1








1








I tried fish for a while, and then i wanted to set it as my default shell. I edited /etc/passwd and changed the shell of my user to /bin/fish.



The problem is I couldn't login anymore. I tried through my DM (SDDM), it said the login failed at any password I threw at it, correct or wrong. Then I tried it through a tty, got the same results. Replacing fish with the shell I had before in my passwd file seemed to fix this.



Is there any way to set fish as the default shell and still be able to login?



I am running Manjaro Linux.










share|improve this question
















I tried fish for a while, and then i wanted to set it as my default shell. I edited /etc/passwd and changed the shell of my user to /bin/fish.



The problem is I couldn't login anymore. I tried through my DM (SDDM), it said the login failed at any password I threw at it, correct or wrong. Then I tried it through a tty, got the same results. Replacing fish with the shell I had before in my passwd file seemed to fix this.



Is there any way to set fish as the default shell and still be able to login?



I am running Manjaro Linux.







linux shell fish






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 17 at 21:45









Kamil Maciorowski

27.8k156184




27.8k156184










asked Jan 17 at 21:25









Andy3153Andy3153

82




82








  • 1





    Your primary mistake was editing /etc/passd by hand. Had you used the appropriate command to change your login shell (e.g., chsh) it would/should have warned you about the problem.

    – Kurtis Rader
    Jan 18 at 5:42














  • 1





    Your primary mistake was editing /etc/passd by hand. Had you used the appropriate command to change your login shell (e.g., chsh) it would/should have warned you about the problem.

    – Kurtis Rader
    Jan 18 at 5:42








1




1





Your primary mistake was editing /etc/passd by hand. Had you used the appropriate command to change your login shell (e.g., chsh) it would/should have warned you about the problem.

– Kurtis Rader
Jan 18 at 5:42





Your primary mistake was editing /etc/passd by hand. Had you used the appropriate command to change your login shell (e.g., chsh) it would/should have warned you about the problem.

– Kurtis Rader
Jan 18 at 5:42










2 Answers
2






active

oldest

votes


















2














You need to add this shell to /etc/shells. The manual reads:




/etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh(1) and available to be queried by other programs.



Be aware that there are programs which consult this file to find out if a user is a normal user; for example, FTP daemons traditionally disallow access to users with shells not included in this file.




In my Kubuntu this is the content of /etc/shells:




# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/usr/bin/tmux
/bin/zsh
/usr/bin/zsh
/usr/bin/fish
/bin/tcsh
/usr/bin/tcsh



As you can see its format is quite self-explanatory. In my case fish is there as /usr/bin/fish. Make sure the right path in your case is /bin/fish and add it to your file.





Note it's better to use chsh to change your login shell, instead of editing /etc/passwd by hand. If you did



chsh -s /bin/fish


you would probably get



chsh: /bin/fish is an invalid shell


Investigating this issue (with man 1 chsh) would probably reveal the existence of /etc/shells to you.



The tool is designed to be run by unprivileged users. If the content of /etc/shells (which is governed by root) is sane, then it's usually impossible for users to lock themselves out. By editing /etc/passwd you may not only lock yourself out like you did; you may (by mistake) break more.






share|improve this answer

































    1














    I believe Linux requires that all valid login shells be listed in /etc/shells. Add fish to that file before setting it as your login shell. Be sure to use its full correct path.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      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%2fsuperuser.com%2fquestions%2f1395540%2ffailed-to-login-after-setting-fish-as-default-shell%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      You need to add this shell to /etc/shells. The manual reads:




      /etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh(1) and available to be queried by other programs.



      Be aware that there are programs which consult this file to find out if a user is a normal user; for example, FTP daemons traditionally disallow access to users with shells not included in this file.




      In my Kubuntu this is the content of /etc/shells:




      # /etc/shells: valid login shells
      /bin/sh
      /bin/dash
      /bin/bash
      /bin/rbash
      /usr/bin/tmux
      /bin/zsh
      /usr/bin/zsh
      /usr/bin/fish
      /bin/tcsh
      /usr/bin/tcsh



      As you can see its format is quite self-explanatory. In my case fish is there as /usr/bin/fish. Make sure the right path in your case is /bin/fish and add it to your file.





      Note it's better to use chsh to change your login shell, instead of editing /etc/passwd by hand. If you did



      chsh -s /bin/fish


      you would probably get



      chsh: /bin/fish is an invalid shell


      Investigating this issue (with man 1 chsh) would probably reveal the existence of /etc/shells to you.



      The tool is designed to be run by unprivileged users. If the content of /etc/shells (which is governed by root) is sane, then it's usually impossible for users to lock themselves out. By editing /etc/passwd you may not only lock yourself out like you did; you may (by mistake) break more.






      share|improve this answer






























        2














        You need to add this shell to /etc/shells. The manual reads:




        /etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh(1) and available to be queried by other programs.



        Be aware that there are programs which consult this file to find out if a user is a normal user; for example, FTP daemons traditionally disallow access to users with shells not included in this file.




        In my Kubuntu this is the content of /etc/shells:




        # /etc/shells: valid login shells
        /bin/sh
        /bin/dash
        /bin/bash
        /bin/rbash
        /usr/bin/tmux
        /bin/zsh
        /usr/bin/zsh
        /usr/bin/fish
        /bin/tcsh
        /usr/bin/tcsh



        As you can see its format is quite self-explanatory. In my case fish is there as /usr/bin/fish. Make sure the right path in your case is /bin/fish and add it to your file.





        Note it's better to use chsh to change your login shell, instead of editing /etc/passwd by hand. If you did



        chsh -s /bin/fish


        you would probably get



        chsh: /bin/fish is an invalid shell


        Investigating this issue (with man 1 chsh) would probably reveal the existence of /etc/shells to you.



        The tool is designed to be run by unprivileged users. If the content of /etc/shells (which is governed by root) is sane, then it's usually impossible for users to lock themselves out. By editing /etc/passwd you may not only lock yourself out like you did; you may (by mistake) break more.






        share|improve this answer




























          2












          2








          2







          You need to add this shell to /etc/shells. The manual reads:




          /etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh(1) and available to be queried by other programs.



          Be aware that there are programs which consult this file to find out if a user is a normal user; for example, FTP daemons traditionally disallow access to users with shells not included in this file.




          In my Kubuntu this is the content of /etc/shells:




          # /etc/shells: valid login shells
          /bin/sh
          /bin/dash
          /bin/bash
          /bin/rbash
          /usr/bin/tmux
          /bin/zsh
          /usr/bin/zsh
          /usr/bin/fish
          /bin/tcsh
          /usr/bin/tcsh



          As you can see its format is quite self-explanatory. In my case fish is there as /usr/bin/fish. Make sure the right path in your case is /bin/fish and add it to your file.





          Note it's better to use chsh to change your login shell, instead of editing /etc/passwd by hand. If you did



          chsh -s /bin/fish


          you would probably get



          chsh: /bin/fish is an invalid shell


          Investigating this issue (with man 1 chsh) would probably reveal the existence of /etc/shells to you.



          The tool is designed to be run by unprivileged users. If the content of /etc/shells (which is governed by root) is sane, then it's usually impossible for users to lock themselves out. By editing /etc/passwd you may not only lock yourself out like you did; you may (by mistake) break more.






          share|improve this answer















          You need to add this shell to /etc/shells. The manual reads:




          /etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh(1) and available to be queried by other programs.



          Be aware that there are programs which consult this file to find out if a user is a normal user; for example, FTP daemons traditionally disallow access to users with shells not included in this file.




          In my Kubuntu this is the content of /etc/shells:




          # /etc/shells: valid login shells
          /bin/sh
          /bin/dash
          /bin/bash
          /bin/rbash
          /usr/bin/tmux
          /bin/zsh
          /usr/bin/zsh
          /usr/bin/fish
          /bin/tcsh
          /usr/bin/tcsh



          As you can see its format is quite self-explanatory. In my case fish is there as /usr/bin/fish. Make sure the right path in your case is /bin/fish and add it to your file.





          Note it's better to use chsh to change your login shell, instead of editing /etc/passwd by hand. If you did



          chsh -s /bin/fish


          you would probably get



          chsh: /bin/fish is an invalid shell


          Investigating this issue (with man 1 chsh) would probably reveal the existence of /etc/shells to you.



          The tool is designed to be run by unprivileged users. If the content of /etc/shells (which is governed by root) is sane, then it's usually impossible for users to lock themselves out. By editing /etc/passwd you may not only lock yourself out like you did; you may (by mistake) break more.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 17 at 22:02

























          answered Jan 17 at 21:42









          Kamil MaciorowskiKamil Maciorowski

          27.8k156184




          27.8k156184

























              1














              I believe Linux requires that all valid login shells be listed in /etc/shells. Add fish to that file before setting it as your login shell. Be sure to use its full correct path.






              share|improve this answer




























                1














                I believe Linux requires that all valid login shells be listed in /etc/shells. Add fish to that file before setting it as your login shell. Be sure to use its full correct path.






                share|improve this answer


























                  1












                  1








                  1







                  I believe Linux requires that all valid login shells be listed in /etc/shells. Add fish to that file before setting it as your login shell. Be sure to use its full correct path.






                  share|improve this answer













                  I believe Linux requires that all valid login shells be listed in /etc/shells. Add fish to that file before setting it as your login shell. Be sure to use its full correct path.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 17 at 21:42









                  SpiffSpiff

                  77.8k10118163




                  77.8k10118163






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • 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%2fsuperuser.com%2fquestions%2f1395540%2ffailed-to-login-after-setting-fish-as-default-shell%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

                      Список кардиналов, возведённых папой римским Каликстом III

                      Deduzione

                      Mysql.sock missing - “Can't connect to local MySQL server through socket”