usermod equivalent for Alpine Linux The Next CEO of Stack OverflowLinux - Debian - Original...

Small nick on power cord from an electric alarm clock, and copper wiring exposed but intact

Could a dragon use hot air to help it take off?

What did the word "leisure" mean in late 18th Century usage?

My boss doesn't want me to have a side project

Does Germany produce more waste than the US?

What does this strange code stamp on my passport mean?

Planeswalker Ability and Death Timing

How dangerous is XSS

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

Can a PhD from a non-TU9 German university become a professor in a TU9 university?

Are British MPs missing the point, with these 'Indicative Votes'?

Is it "common practice in Fourier transform spectroscopy to multiply the measured interferogram by an apodizing function"? If so, why?

My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?

How does a dynamic QR code work?

Finitely generated matrix groups whose eigenvalues are all algebraic

How exploitable/balanced is this homebrew spell: Spell Permanency?

Free fall ellipse or parabola?

How seriously should I take size and weight limits of hand luggage?

How to show a landlord what we have in savings?

Incomplete cube

Gödel's incompleteness theorems - what are the religious implications?

Do I need to write [sic] when including a quotation with a number less than 10 that isn't written out?

Can Sri Krishna be called 'a person'?

Is there a rule of thumb for determining the amount one should accept for a settlement offer?



usermod equivalent for Alpine Linux



The Next CEO of Stack OverflowLinux - Debian - Original groups that a user is inHow to install a specific package version in Alpine?What is a prescriptive way for managing the permissions for mounted volumes in Alpine-based Docker?How to install npm in alpine linuxFixate version alpine linux apk package (in container)How to install specific version of libxml2 on Alpine linux without downgrade of whole alpine to v3.1?What is the best way to install latest nodejs with npm on alpine linuxPython wx-widgets in Alpine LinuxShare a directory with one (not all) other non-root user on Linux (no root privileges)Docker group assignment doesn't affect the user












1















I'm building a Docker container, and I need to add my user to a group. usermod is not available in Alpine Linux by default. Apparently, you can add shadow from apk to install usermod, but I would prefer to not install additional packages.



Is there an alternative way to add a user to a group, or an equivalent tool to usermod available in Alpine?










share|improve this question























  • Have you seen this? Basically adding environment variables for UID and GID when initializing.

    – JakeGould
    Jan 17 at 17:20






  • 2





    Why not simply modify the /etc/group file directly?

    – davidgo
    Jan 17 at 18:12











  • @davidgo Some people don’t know you can just edit it like that but it’s a good solution. Would need to be scriptable via sed or something like that.

    – JakeGould
    Jan 17 at 21:09
















1















I'm building a Docker container, and I need to add my user to a group. usermod is not available in Alpine Linux by default. Apparently, you can add shadow from apk to install usermod, but I would prefer to not install additional packages.



Is there an alternative way to add a user to a group, or an equivalent tool to usermod available in Alpine?










share|improve this question























  • Have you seen this? Basically adding environment variables for UID and GID when initializing.

    – JakeGould
    Jan 17 at 17:20






  • 2





    Why not simply modify the /etc/group file directly?

    – davidgo
    Jan 17 at 18:12











  • @davidgo Some people don’t know you can just edit it like that but it’s a good solution. Would need to be scriptable via sed or something like that.

    – JakeGould
    Jan 17 at 21:09














1












1








1








I'm building a Docker container, and I need to add my user to a group. usermod is not available in Alpine Linux by default. Apparently, you can add shadow from apk to install usermod, but I would prefer to not install additional packages.



Is there an alternative way to add a user to a group, or an equivalent tool to usermod available in Alpine?










share|improve this question














I'm building a Docker container, and I need to add my user to a group. usermod is not available in Alpine Linux by default. Apparently, you can add shadow from apk to install usermod, but I would prefer to not install additional packages.



Is there an alternative way to add a user to a group, or an equivalent tool to usermod available in Alpine?







user-accounts user-groups alpine-linux






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 17 at 17:13









ZakZak

1063




1063













  • Have you seen this? Basically adding environment variables for UID and GID when initializing.

    – JakeGould
    Jan 17 at 17:20






  • 2





    Why not simply modify the /etc/group file directly?

    – davidgo
    Jan 17 at 18:12











  • @davidgo Some people don’t know you can just edit it like that but it’s a good solution. Would need to be scriptable via sed or something like that.

    – JakeGould
    Jan 17 at 21:09



















  • Have you seen this? Basically adding environment variables for UID and GID when initializing.

    – JakeGould
    Jan 17 at 17:20






  • 2





    Why not simply modify the /etc/group file directly?

    – davidgo
    Jan 17 at 18:12











  • @davidgo Some people don’t know you can just edit it like that but it’s a good solution. Would need to be scriptable via sed or something like that.

    – JakeGould
    Jan 17 at 21:09

















Have you seen this? Basically adding environment variables for UID and GID when initializing.

– JakeGould
Jan 17 at 17:20





Have you seen this? Basically adding environment variables for UID and GID when initializing.

– JakeGould
Jan 17 at 17:20




2




2





Why not simply modify the /etc/group file directly?

– davidgo
Jan 17 at 18:12





Why not simply modify the /etc/group file directly?

– davidgo
Jan 17 at 18:12













@davidgo Some people don’t know you can just edit it like that but it’s a good solution. Would need to be scriptable via sed or something like that.

– JakeGould
Jan 17 at 21:09





@davidgo Some people don’t know you can just edit it like that but it’s a good solution. Would need to be scriptable via sed or something like that.

– JakeGould
Jan 17 at 21:09










1 Answer
1






active

oldest

votes


















0














You should be able to use the built-in addgroup command to add the user to a given group:



$ addgroup --help
BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.

Usage: addgroup [-g GID] [-S] [USER] GROUP

Add a group or add a user to a group

-g GID Group id
-S Create a system group


So running addgroup ${USER} ${GROUP} should update /etc/groups without needing to edit the file directly.






share|improve this answer








New contributor




tzrlk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















    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%2f1395473%2fusermod-equivalent-for-alpine-linux%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You should be able to use the built-in addgroup command to add the user to a given group:



    $ addgroup --help
    BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.

    Usage: addgroup [-g GID] [-S] [USER] GROUP

    Add a group or add a user to a group

    -g GID Group id
    -S Create a system group


    So running addgroup ${USER} ${GROUP} should update /etc/groups without needing to edit the file directly.






    share|improve this answer








    New contributor




    tzrlk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      You should be able to use the built-in addgroup command to add the user to a given group:



      $ addgroup --help
      BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.

      Usage: addgroup [-g GID] [-S] [USER] GROUP

      Add a group or add a user to a group

      -g GID Group id
      -S Create a system group


      So running addgroup ${USER} ${GROUP} should update /etc/groups without needing to edit the file directly.






      share|improve this answer








      New contributor




      tzrlk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        You should be able to use the built-in addgroup command to add the user to a given group:



        $ addgroup --help
        BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.

        Usage: addgroup [-g GID] [-S] [USER] GROUP

        Add a group or add a user to a group

        -g GID Group id
        -S Create a system group


        So running addgroup ${USER} ${GROUP} should update /etc/groups without needing to edit the file directly.






        share|improve this answer








        New contributor




        tzrlk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        You should be able to use the built-in addgroup command to add the user to a given group:



        $ addgroup --help
        BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.

        Usage: addgroup [-g GID] [-S] [USER] GROUP

        Add a group or add a user to a group

        -g GID Group id
        -S Create a system group


        So running addgroup ${USER} ${GROUP} should update /etc/groups without needing to edit the file directly.







        share|improve this answer








        New contributor




        tzrlk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        tzrlk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 3 hours ago









        tzrlktzrlk

        1013




        1013




        New contributor




        tzrlk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        tzrlk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        tzrlk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            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%2f1395473%2fusermod-equivalent-for-alpine-linux%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

            Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

            VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

            Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...