usermod says account doesn't exist but adduser says it does











up vote
0
down vote

favorite












I run the command



usermod -a -G dialout amashreghi


but I get amashreghi doesn't exists, however, when I try to add the user using adduser



adduser amashreghi


It says that amashreghi already exists. What's going on?!










share|improve this question
























  • Does amashreghi have a password?
    – George Udosen
    Oct 11 '17 at 20:15










  • Yes, I am sudo user but not root. I have tried usermod with sudo as well though.
    – A. Mashreghi
    Oct 11 '17 at 20:37















up vote
0
down vote

favorite












I run the command



usermod -a -G dialout amashreghi


but I get amashreghi doesn't exists, however, when I try to add the user using adduser



adduser amashreghi


It says that amashreghi already exists. What's going on?!










share|improve this question
























  • Does amashreghi have a password?
    – George Udosen
    Oct 11 '17 at 20:15










  • Yes, I am sudo user but not root. I have tried usermod with sudo as well though.
    – A. Mashreghi
    Oct 11 '17 at 20:37













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I run the command



usermod -a -G dialout amashreghi


but I get amashreghi doesn't exists, however, when I try to add the user using adduser



adduser amashreghi


It says that amashreghi already exists. What's going on?!










share|improve this question















I run the command



usermod -a -G dialout amashreghi


but I get amashreghi doesn't exists, however, when I try to add the user using adduser



adduser amashreghi


It says that amashreghi already exists. What's going on?!







adduser accounts






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 11 '17 at 20:14









George Udosen

19k94266




19k94266










asked Oct 11 '17 at 20:11









A. Mashreghi

1012




1012












  • Does amashreghi have a password?
    – George Udosen
    Oct 11 '17 at 20:15










  • Yes, I am sudo user but not root. I have tried usermod with sudo as well though.
    – A. Mashreghi
    Oct 11 '17 at 20:37


















  • Does amashreghi have a password?
    – George Udosen
    Oct 11 '17 at 20:15










  • Yes, I am sudo user but not root. I have tried usermod with sudo as well though.
    – A. Mashreghi
    Oct 11 '17 at 20:37
















Does amashreghi have a password?
– George Udosen
Oct 11 '17 at 20:15




Does amashreghi have a password?
– George Udosen
Oct 11 '17 at 20:15












Yes, I am sudo user but not root. I have tried usermod with sudo as well though.
– A. Mashreghi
Oct 11 '17 at 20:37




Yes, I am sudo user but not root. I have tried usermod with sudo as well though.
– A. Mashreghi
Oct 11 '17 at 20:37










3 Answers
3






active

oldest

votes

















up vote
0
down vote













Give this a try. (I'm assuming that you're ready to delete everything associated with this user and start over, don't run these if you're not.)



userdel -r amashreghi
grep amashreghi /etc/passwd


If that second command returns anything, run:



sudo -H gedit /etc/passwd


Remove the line that begins with amashreghi, and save the file. Try adding the user again now.






share|improve this answer






























    up vote
    0
    down vote













    To edit /etc/group directly use vigr



    From man vigr



    NAME
    vipw, vigr - edit the password, group, shadow-password or shadow-group file

    SYNOPSIS
    vipw [options]

    vigr [options]

    DESCRIPTION
    The vipw and vigr commands edits the files /etc/passwd and /etc/group, respectively. With the -s flag,
    they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The
    programs will set the appropriate locks to prevent file corruption. When looking for an editor, the
    programs will first try the environment variable $VISUAL, then the environment variable $EDITOR, and
    finally the default editor, vi(1).


    Hence, you can edit the /etc/group file with



    sudo vigr


    The format of group entries can be found in man.
    From man group:



    NAME
    group - user group file

    DESCRIPTION
    The /etc/group file is a text file that defines the groups on the system. There is one entry per line,
    with the following format:

    group_name:password:GID:user_list

    The fields are as follows:

    group_name the name of the group.

    password the (encrypted) group password. If this field is empty, no password is needed.

    GID the numeric group ID.

    user_list a list of the usernames that are members of this group, separated by commas.

    FILES
    /etc/group





    share|improve this answer






























      up vote
      -1
      down vote













      Just do this:



      sudo vim /etc/group


      and add your name to the desired group, like:



      somegroup:x:25:yourusername





      share|improve this answer

















      • 1




        Vim is not recommended to edit the group file: see unix.stackexchange.com/a/79177/262708
        – abu_bua
        Nov 28 at 14:28











      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: 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%2f964040%2fusermod-says-account-doesnt-exist-but-adduser-says-it-does%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








      up vote
      0
      down vote













      Give this a try. (I'm assuming that you're ready to delete everything associated with this user and start over, don't run these if you're not.)



      userdel -r amashreghi
      grep amashreghi /etc/passwd


      If that second command returns anything, run:



      sudo -H gedit /etc/passwd


      Remove the line that begins with amashreghi, and save the file. Try adding the user again now.






      share|improve this answer



























        up vote
        0
        down vote













        Give this a try. (I'm assuming that you're ready to delete everything associated with this user and start over, don't run these if you're not.)



        userdel -r amashreghi
        grep amashreghi /etc/passwd


        If that second command returns anything, run:



        sudo -H gedit /etc/passwd


        Remove the line that begins with amashreghi, and save the file. Try adding the user again now.






        share|improve this answer

























          up vote
          0
          down vote










          up vote
          0
          down vote









          Give this a try. (I'm assuming that you're ready to delete everything associated with this user and start over, don't run these if you're not.)



          userdel -r amashreghi
          grep amashreghi /etc/passwd


          If that second command returns anything, run:



          sudo -H gedit /etc/passwd


          Remove the line that begins with amashreghi, and save the file. Try adding the user again now.






          share|improve this answer














          Give this a try. (I'm assuming that you're ready to delete everything associated with this user and start over, don't run these if you're not.)



          userdel -r amashreghi
          grep amashreghi /etc/passwd


          If that second command returns anything, run:



          sudo -H gedit /etc/passwd


          Remove the line that begins with amashreghi, and save the file. Try adding the user again now.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 11 '17 at 23:23









          Eliah Kagan

          81k20226364




          81k20226364










          answered Oct 11 '17 at 23:21









          P3TR1CH0R

          1




          1
























              up vote
              0
              down vote













              To edit /etc/group directly use vigr



              From man vigr



              NAME
              vipw, vigr - edit the password, group, shadow-password or shadow-group file

              SYNOPSIS
              vipw [options]

              vigr [options]

              DESCRIPTION
              The vipw and vigr commands edits the files /etc/passwd and /etc/group, respectively. With the -s flag,
              they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The
              programs will set the appropriate locks to prevent file corruption. When looking for an editor, the
              programs will first try the environment variable $VISUAL, then the environment variable $EDITOR, and
              finally the default editor, vi(1).


              Hence, you can edit the /etc/group file with



              sudo vigr


              The format of group entries can be found in man.
              From man group:



              NAME
              group - user group file

              DESCRIPTION
              The /etc/group file is a text file that defines the groups on the system. There is one entry per line,
              with the following format:

              group_name:password:GID:user_list

              The fields are as follows:

              group_name the name of the group.

              password the (encrypted) group password. If this field is empty, no password is needed.

              GID the numeric group ID.

              user_list a list of the usernames that are members of this group, separated by commas.

              FILES
              /etc/group





              share|improve this answer



























                up vote
                0
                down vote













                To edit /etc/group directly use vigr



                From man vigr



                NAME
                vipw, vigr - edit the password, group, shadow-password or shadow-group file

                SYNOPSIS
                vipw [options]

                vigr [options]

                DESCRIPTION
                The vipw and vigr commands edits the files /etc/passwd and /etc/group, respectively. With the -s flag,
                they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The
                programs will set the appropriate locks to prevent file corruption. When looking for an editor, the
                programs will first try the environment variable $VISUAL, then the environment variable $EDITOR, and
                finally the default editor, vi(1).


                Hence, you can edit the /etc/group file with



                sudo vigr


                The format of group entries can be found in man.
                From man group:



                NAME
                group - user group file

                DESCRIPTION
                The /etc/group file is a text file that defines the groups on the system. There is one entry per line,
                with the following format:

                group_name:password:GID:user_list

                The fields are as follows:

                group_name the name of the group.

                password the (encrypted) group password. If this field is empty, no password is needed.

                GID the numeric group ID.

                user_list a list of the usernames that are members of this group, separated by commas.

                FILES
                /etc/group





                share|improve this answer

























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  To edit /etc/group directly use vigr



                  From man vigr



                  NAME
                  vipw, vigr - edit the password, group, shadow-password or shadow-group file

                  SYNOPSIS
                  vipw [options]

                  vigr [options]

                  DESCRIPTION
                  The vipw and vigr commands edits the files /etc/passwd and /etc/group, respectively. With the -s flag,
                  they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The
                  programs will set the appropriate locks to prevent file corruption. When looking for an editor, the
                  programs will first try the environment variable $VISUAL, then the environment variable $EDITOR, and
                  finally the default editor, vi(1).


                  Hence, you can edit the /etc/group file with



                  sudo vigr


                  The format of group entries can be found in man.
                  From man group:



                  NAME
                  group - user group file

                  DESCRIPTION
                  The /etc/group file is a text file that defines the groups on the system. There is one entry per line,
                  with the following format:

                  group_name:password:GID:user_list

                  The fields are as follows:

                  group_name the name of the group.

                  password the (encrypted) group password. If this field is empty, no password is needed.

                  GID the numeric group ID.

                  user_list a list of the usernames that are members of this group, separated by commas.

                  FILES
                  /etc/group





                  share|improve this answer














                  To edit /etc/group directly use vigr



                  From man vigr



                  NAME
                  vipw, vigr - edit the password, group, shadow-password or shadow-group file

                  SYNOPSIS
                  vipw [options]

                  vigr [options]

                  DESCRIPTION
                  The vipw and vigr commands edits the files /etc/passwd and /etc/group, respectively. With the -s flag,
                  they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The
                  programs will set the appropriate locks to prevent file corruption. When looking for an editor, the
                  programs will first try the environment variable $VISUAL, then the environment variable $EDITOR, and
                  finally the default editor, vi(1).


                  Hence, you can edit the /etc/group file with



                  sudo vigr


                  The format of group entries can be found in man.
                  From man group:



                  NAME
                  group - user group file

                  DESCRIPTION
                  The /etc/group file is a text file that defines the groups on the system. There is one entry per line,
                  with the following format:

                  group_name:password:GID:user_list

                  The fields are as follows:

                  group_name the name of the group.

                  password the (encrypted) group password. If this field is empty, no password is needed.

                  GID the numeric group ID.

                  user_list a list of the usernames that are members of this group, separated by commas.

                  FILES
                  /etc/group






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 28 at 14:48

























                  answered Nov 28 at 14:34









                  abu_bua

                  3,15081023




                  3,15081023






















                      up vote
                      -1
                      down vote













                      Just do this:



                      sudo vim /etc/group


                      and add your name to the desired group, like:



                      somegroup:x:25:yourusername





                      share|improve this answer

















                      • 1




                        Vim is not recommended to edit the group file: see unix.stackexchange.com/a/79177/262708
                        – abu_bua
                        Nov 28 at 14:28















                      up vote
                      -1
                      down vote













                      Just do this:



                      sudo vim /etc/group


                      and add your name to the desired group, like:



                      somegroup:x:25:yourusername





                      share|improve this answer

















                      • 1




                        Vim is not recommended to edit the group file: see unix.stackexchange.com/a/79177/262708
                        – abu_bua
                        Nov 28 at 14:28













                      up vote
                      -1
                      down vote










                      up vote
                      -1
                      down vote









                      Just do this:



                      sudo vim /etc/group


                      and add your name to the desired group, like:



                      somegroup:x:25:yourusername





                      share|improve this answer












                      Just do this:



                      sudo vim /etc/group


                      and add your name to the desired group, like:



                      somegroup:x:25:yourusername






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 28 at 13:28









                      David Joos

                      11




                      11








                      • 1




                        Vim is not recommended to edit the group file: see unix.stackexchange.com/a/79177/262708
                        – abu_bua
                        Nov 28 at 14:28














                      • 1




                        Vim is not recommended to edit the group file: see unix.stackexchange.com/a/79177/262708
                        – abu_bua
                        Nov 28 at 14:28








                      1




                      1




                      Vim is not recommended to edit the group file: see unix.stackexchange.com/a/79177/262708
                      – abu_bua
                      Nov 28 at 14:28




                      Vim is not recommended to edit the group file: see unix.stackexchange.com/a/79177/262708
                      – abu_bua
                      Nov 28 at 14:28


















                      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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2f964040%2fusermod-says-account-doesnt-exist-but-adduser-says-it-does%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

                      Quarter-circle Tiles

                      build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                      Mont Emei