SOLVED - cannot su into root default shell - debianHow to grant read/write to specific user in any existent...

How can I detect if I'm in a subshell?

How would Japanese people react to someone refusing to say “itadakimasu” for religious reasons?

How to search for Android apps without ads?

What does a/.b[c][[1]] mean?

How to make all magic-casting innate, but still rare?

Are their examples of rowers who also fought?

How to ask if I can mow my neighbor's lawn

How to prevent cables getting intertwined

How do I gain the trust of other PCs?

Why do you need to heat the pan before heating the olive oil?

High-end PC graphics circa 1990?

Have Steve Rogers (Captain America) and a young Erik Lehnsherr (Magneto) interacted during WWII?

What do I put on my resume to make the company i'm applying to think i'm mature enough to handle a job?

100-doors puzzle

Why can't I craft scaffolding in Minecraft 1.14?

Would a 7805 5v regulator drain a 9v battery?

What could be the physiological mechanism for a biological Geiger counter?

How could I create a situation in which a PC has to make a saving throw or be forced to pet a dog?

How to comprehend this notation?

Explicit direct #include vs. Non-contractual transitive #include

2 Managed Packages in 1 Dev Org

Leveraging cash for buying car

Basic power tool set for Home repair and simple projects

Why can't we feel the Earth's revolution?



SOLVED - cannot su into root default shell - debian


How to grant read/write to specific user in any existent or future subdirectory of a given directory?How to correctly enable sudo for user in Fedora 20Open the SSH Door to a Knocking FriendAllow SSH access but restrict root's access to a given set of IPsHow to add myself to sudoers when I have no root access on my debian machine?Git Bash for both Ubuntu/Linux and Windows requires ssh-agent on restartHow to add the only user on a Debian system back into the sudo group?Git asks for password when using SSH URL, ssh does notunable to add user to group fedora 29Restrict root shell access






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I am using a debian 9 server.



Usually I access via ssh to a normal user (say user1) and su into root, because I disabled ssh into root.
Lately I was setting up a git-server where I created a user git with the group git and restricted him to git-shell.
Playing around a little while a added user1 to the group git like this



usermod -aG git user1


This worked alright, user1 was member of the groups user1 and git.
At the end I wanted to undo this, so I used



usermod -G user1 user1


Shortly after this, I lost my internet connection and had to reconnect. I can ssh into user1 alright, but when using su to access root, there is an error:



user1@hostname:~$ su 
Password:
Cannot execute git: No such file or directory
user1@hostname:~$


I included the information about git-shell, because I have no idea what else could be the reason. Hopefully it is not all lost and somebody can help me to regain control.



PS: There isnt any other root-like user, so sudo isnt working, since user1 "is not in the sudoers file".



PPS: I could reset the root password via VPS-login, but I am not quite sure whether this is going to work or make everything worse...










share|improve this question









New contributor



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




















  • Can you try su -s /bin/sh to try to get a root shell?

    – doneal24
    2 hours ago











  • unfortunately same error...

    – Pratched
    2 hours ago













  • To work it some more, how about su -s /bin/sh -c /bin/sh? Seems like overkill but it's worth a try.

    – doneal24
    1 hour ago











  • Cannot execute git - so similar error, the "missing directory" ist not mentioned here

    – Pratched
    1 hour ago











  • would root password reset be worth a try?

    – Pratched
    1 hour ago


















1















I am using a debian 9 server.



Usually I access via ssh to a normal user (say user1) and su into root, because I disabled ssh into root.
Lately I was setting up a git-server where I created a user git with the group git and restricted him to git-shell.
Playing around a little while a added user1 to the group git like this



usermod -aG git user1


This worked alright, user1 was member of the groups user1 and git.
At the end I wanted to undo this, so I used



usermod -G user1 user1


Shortly after this, I lost my internet connection and had to reconnect. I can ssh into user1 alright, but when using su to access root, there is an error:



user1@hostname:~$ su 
Password:
Cannot execute git: No such file or directory
user1@hostname:~$


I included the information about git-shell, because I have no idea what else could be the reason. Hopefully it is not all lost and somebody can help me to regain control.



PS: There isnt any other root-like user, so sudo isnt working, since user1 "is not in the sudoers file".



PPS: I could reset the root password via VPS-login, but I am not quite sure whether this is going to work or make everything worse...










share|improve this question









New contributor



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




















  • Can you try su -s /bin/sh to try to get a root shell?

    – doneal24
    2 hours ago











  • unfortunately same error...

    – Pratched
    2 hours ago













  • To work it some more, how about su -s /bin/sh -c /bin/sh? Seems like overkill but it's worth a try.

    – doneal24
    1 hour ago











  • Cannot execute git - so similar error, the "missing directory" ist not mentioned here

    – Pratched
    1 hour ago











  • would root password reset be worth a try?

    – Pratched
    1 hour ago














1












1








1








I am using a debian 9 server.



Usually I access via ssh to a normal user (say user1) and su into root, because I disabled ssh into root.
Lately I was setting up a git-server where I created a user git with the group git and restricted him to git-shell.
Playing around a little while a added user1 to the group git like this



usermod -aG git user1


This worked alright, user1 was member of the groups user1 and git.
At the end I wanted to undo this, so I used



usermod -G user1 user1


Shortly after this, I lost my internet connection and had to reconnect. I can ssh into user1 alright, but when using su to access root, there is an error:



user1@hostname:~$ su 
Password:
Cannot execute git: No such file or directory
user1@hostname:~$


I included the information about git-shell, because I have no idea what else could be the reason. Hopefully it is not all lost and somebody can help me to regain control.



PS: There isnt any other root-like user, so sudo isnt working, since user1 "is not in the sudoers file".



PPS: I could reset the root password via VPS-login, but I am not quite sure whether this is going to work or make everything worse...










share|improve this question









New contributor



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











I am using a debian 9 server.



Usually I access via ssh to a normal user (say user1) and su into root, because I disabled ssh into root.
Lately I was setting up a git-server where I created a user git with the group git and restricted him to git-shell.
Playing around a little while a added user1 to the group git like this



usermod -aG git user1


This worked alright, user1 was member of the groups user1 and git.
At the end I wanted to undo this, so I used



usermod -G user1 user1


Shortly after this, I lost my internet connection and had to reconnect. I can ssh into user1 alright, but when using su to access root, there is an error:



user1@hostname:~$ su 
Password:
Cannot execute git: No such file or directory
user1@hostname:~$


I included the information about git-shell, because I have no idea what else could be the reason. Hopefully it is not all lost and somebody can help me to regain control.



PS: There isnt any other root-like user, so sudo isnt working, since user1 "is not in the sudoers file".



PPS: I could reset the root password via VPS-login, but I am not quite sure whether this is going to work or make everything worse...







debian root git usermod






share|improve this question









New contributor



Pratched 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 question









New contributor



Pratched 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 question




share|improve this question








edited 48 mins ago







Pratched













New contributor



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








asked 2 hours ago









PratchedPratched

62




62




New contributor



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




New contributor




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















  • Can you try su -s /bin/sh to try to get a root shell?

    – doneal24
    2 hours ago











  • unfortunately same error...

    – Pratched
    2 hours ago













  • To work it some more, how about su -s /bin/sh -c /bin/sh? Seems like overkill but it's worth a try.

    – doneal24
    1 hour ago











  • Cannot execute git - so similar error, the "missing directory" ist not mentioned here

    – Pratched
    1 hour ago











  • would root password reset be worth a try?

    – Pratched
    1 hour ago



















  • Can you try su -s /bin/sh to try to get a root shell?

    – doneal24
    2 hours ago











  • unfortunately same error...

    – Pratched
    2 hours ago













  • To work it some more, how about su -s /bin/sh -c /bin/sh? Seems like overkill but it's worth a try.

    – doneal24
    1 hour ago











  • Cannot execute git - so similar error, the "missing directory" ist not mentioned here

    – Pratched
    1 hour ago











  • would root password reset be worth a try?

    – Pratched
    1 hour ago

















Can you try su -s /bin/sh to try to get a root shell?

– doneal24
2 hours ago





Can you try su -s /bin/sh to try to get a root shell?

– doneal24
2 hours ago













unfortunately same error...

– Pratched
2 hours ago







unfortunately same error...

– Pratched
2 hours ago















To work it some more, how about su -s /bin/sh -c /bin/sh? Seems like overkill but it's worth a try.

– doneal24
1 hour ago





To work it some more, how about su -s /bin/sh -c /bin/sh? Seems like overkill but it's worth a try.

– doneal24
1 hour ago













Cannot execute git - so similar error, the "missing directory" ist not mentioned here

– Pratched
1 hour ago





Cannot execute git - so similar error, the "missing directory" ist not mentioned here

– Pratched
1 hour ago













would root password reset be worth a try?

– Pratched
1 hour ago





would root password reset be worth a try?

– Pratched
1 hour ago










1 Answer
1






active

oldest

votes


















0














I did not find the reason (yet), but based on the comments of @doneal24 I regained control over my system. If i can clearify the reason, I will provide the details.



Since neither



su -s /bin/sh


nor



su -s /bin/sh -c /bin/sh


were working, this is what solved my issue:




  • boot into "rescue mode" - probably available at most VPS


  • mount appropiate drive

  • nano /path/to/mounted/drive/etc/passwd

  • change root entry to root:x:0:0:root:/root:/bin/bash

  • save, exit and reboot without rescue mode






share|improve this answer








New contributor



Pratched 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: "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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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
    });


    }
    });






    Pratched is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f525051%2fsolved-cannot-su-into-root-default-shell-debian%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














    I did not find the reason (yet), but based on the comments of @doneal24 I regained control over my system. If i can clearify the reason, I will provide the details.



    Since neither



    su -s /bin/sh


    nor



    su -s /bin/sh -c /bin/sh


    were working, this is what solved my issue:




    • boot into "rescue mode" - probably available at most VPS


    • mount appropiate drive

    • nano /path/to/mounted/drive/etc/passwd

    • change root entry to root:x:0:0:root:/root:/bin/bash

    • save, exit and reboot without rescue mode






    share|improve this answer








    New contributor



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
























      0














      I did not find the reason (yet), but based on the comments of @doneal24 I regained control over my system. If i can clearify the reason, I will provide the details.



      Since neither



      su -s /bin/sh


      nor



      su -s /bin/sh -c /bin/sh


      were working, this is what solved my issue:




      • boot into "rescue mode" - probably available at most VPS


      • mount appropiate drive

      • nano /path/to/mounted/drive/etc/passwd

      • change root entry to root:x:0:0:root:/root:/bin/bash

      • save, exit and reboot without rescue mode






      share|improve this answer








      New contributor



      Pratched 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







        I did not find the reason (yet), but based on the comments of @doneal24 I regained control over my system. If i can clearify the reason, I will provide the details.



        Since neither



        su -s /bin/sh


        nor



        su -s /bin/sh -c /bin/sh


        were working, this is what solved my issue:




        • boot into "rescue mode" - probably available at most VPS


        • mount appropiate drive

        • nano /path/to/mounted/drive/etc/passwd

        • change root entry to root:x:0:0:root:/root:/bin/bash

        • save, exit and reboot without rescue mode






        share|improve this answer








        New contributor



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









        I did not find the reason (yet), but based on the comments of @doneal24 I regained control over my system. If i can clearify the reason, I will provide the details.



        Since neither



        su -s /bin/sh


        nor



        su -s /bin/sh -c /bin/sh


        were working, this is what solved my issue:




        • boot into "rescue mode" - probably available at most VPS


        • mount appropiate drive

        • nano /path/to/mounted/drive/etc/passwd

        • change root entry to root:x:0:0:root:/root:/bin/bash

        • save, exit and reboot without rescue mode







        share|improve this answer








        New contributor



        Pratched 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



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








        answered 40 mins ago









        PratchedPratched

        62




        62




        New contributor



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




        New contributor




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
























            Pratched is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Pratched is a new contributor. Be nice, and check out our Code of Conduct.













            Pratched is a new contributor. Be nice, and check out our Code of Conduct.












            Pratched is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • 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%2funix.stackexchange.com%2fquestions%2f525051%2fsolved-cannot-su-into-root-default-shell-debian%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

            Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

            Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

            Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...