Permission denied please try again ssh error

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I had a root access to my server and I was logged in through ssh. I I did this in my



AllowUsers john


/etc/ssh/sshd_config



in this file.



Now after this I rebooted the server. now I am unable to login through root user and unable to login through john as well. nothing is working. Please help?



my root user was this e.g root@ip



If I try to login ssh root@ip through root it says this



Permission denied, please try again.



If I try to login with john it says



Shell access is not enabled on your account!
If you need shell access please contact support.



I don't understand why I am unable to login through my root account.



Note: I can successfully login through in WHM










share|improve this question



















  • 1




    can you post the exact command and (error) output of the terminal when you are trying to log in as john?
    – Sebastian Stark
    Apr 10 at 19:23










  • @ Sebastian Stark if I try to login through john it says Shell access is not enabled on your account! If you need shell access please contact support.
    – mynameisbutt
    Apr 10 at 19:26










  • @SebastianStark I have updated my question
    – mynameisbutt
    Apr 10 at 19:28














up vote
0
down vote

favorite












I had a root access to my server and I was logged in through ssh. I I did this in my



AllowUsers john


/etc/ssh/sshd_config



in this file.



Now after this I rebooted the server. now I am unable to login through root user and unable to login through john as well. nothing is working. Please help?



my root user was this e.g root@ip



If I try to login ssh root@ip through root it says this



Permission denied, please try again.



If I try to login with john it says



Shell access is not enabled on your account!
If you need shell access please contact support.



I don't understand why I am unable to login through my root account.



Note: I can successfully login through in WHM










share|improve this question



















  • 1




    can you post the exact command and (error) output of the terminal when you are trying to log in as john?
    – Sebastian Stark
    Apr 10 at 19:23










  • @ Sebastian Stark if I try to login through john it says Shell access is not enabled on your account! If you need shell access please contact support.
    – mynameisbutt
    Apr 10 at 19:26










  • @SebastianStark I have updated my question
    – mynameisbutt
    Apr 10 at 19:28












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I had a root access to my server and I was logged in through ssh. I I did this in my



AllowUsers john


/etc/ssh/sshd_config



in this file.



Now after this I rebooted the server. now I am unable to login through root user and unable to login through john as well. nothing is working. Please help?



my root user was this e.g root@ip



If I try to login ssh root@ip through root it says this



Permission denied, please try again.



If I try to login with john it says



Shell access is not enabled on your account!
If you need shell access please contact support.



I don't understand why I am unable to login through my root account.



Note: I can successfully login through in WHM










share|improve this question















I had a root access to my server and I was logged in through ssh. I I did this in my



AllowUsers john


/etc/ssh/sshd_config



in this file.



Now after this I rebooted the server. now I am unable to login through root user and unable to login through john as well. nothing is working. Please help?



my root user was this e.g root@ip



If I try to login ssh root@ip through root it says this



Permission denied, please try again.



If I try to login with john it says



Shell access is not enabled on your account!
If you need shell access please contact support.



I don't understand why I am unable to login through my root account.



Note: I can successfully login through in WHM







server ssh users






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 10 at 20:50

























asked Apr 10 at 19:20









mynameisbutt

11




11







  • 1




    can you post the exact command and (error) output of the terminal when you are trying to log in as john?
    – Sebastian Stark
    Apr 10 at 19:23










  • @ Sebastian Stark if I try to login through john it says Shell access is not enabled on your account! If you need shell access please contact support.
    – mynameisbutt
    Apr 10 at 19:26










  • @SebastianStark I have updated my question
    – mynameisbutt
    Apr 10 at 19:28












  • 1




    can you post the exact command and (error) output of the terminal when you are trying to log in as john?
    – Sebastian Stark
    Apr 10 at 19:23










  • @ Sebastian Stark if I try to login through john it says Shell access is not enabled on your account! If you need shell access please contact support.
    – mynameisbutt
    Apr 10 at 19:26










  • @SebastianStark I have updated my question
    – mynameisbutt
    Apr 10 at 19:28







1




1




can you post the exact command and (error) output of the terminal when you are trying to log in as john?
– Sebastian Stark
Apr 10 at 19:23




can you post the exact command and (error) output of the terminal when you are trying to log in as john?
– Sebastian Stark
Apr 10 at 19:23












@ Sebastian Stark if I try to login through john it says Shell access is not enabled on your account! If you need shell access please contact support.
– mynameisbutt
Apr 10 at 19:26




@ Sebastian Stark if I try to login through john it says Shell access is not enabled on your account! If you need shell access please contact support.
– mynameisbutt
Apr 10 at 19:26












@SebastianStark I have updated my question
– mynameisbutt
Apr 10 at 19:28




@SebastianStark I have updated my question
– mynameisbutt
Apr 10 at 19:28










2 Answers
2






active

oldest

votes

















up vote
1
down vote













Also note: the AllowUsers specifies that login is allowed only for those user names that match a pattern listed with this keyword. By default, login is allowed for all user names. So, with your configuration, john is the only user that can log in using ssh.



The answer from Sebastian Stark is also correct: root would not be able to login by default, even if you had included root in AllowUsers.



So: I recommend, first, making sure that user john can login correctly. Make sure that john has a shell assigned in /etc/passwd and give him one using chsh if necessary. Then, login as john and use sudo if you need root access.






share|improve this answer





























    up vote
    1
    down vote













    By default, logging in as root using password is disabled. You should change the PermitRootLogin setting in /etc/ssh/sshd_config accordingly to allow that, if it is what you want. Alternatively set up public key authentication for the root account. See e. g. How to set up passwordless SSH access for root user for an example. Unfortunately this will be impossible to do without help from your hoster if you really locked yourself out and logging in as john also does not work.



    In addition to this, if you do not add root to the AllowUser directive as well, the setting of PermitRootLogin will have no effect anyway.



    So to fix your particular problem make those two settings in sshd_config look like this:



    PermitRootLogin yes
    AllowUsers root john


    and then restart sshd or reboot the server. Afterwards you should be able to log in as root using a password.



    As for the error message when you are trying to log in as john: This does not look like a normal ssh or Ubuntu error message but rather something your hoster added. You should probably do what it says and contact support.



    Safety measures



    In general, if you are messing with sshd settings there is an easy way to test things: Simply restart the sshd service using service ssh restart and try things out from another terminal. Do not terminate your existing session. If something goes wrong you still have the running session and can revert the wrong settings.



    Rebooting the whole server is never necessary for activating changes to sshd.






    share|improve this answer






















    • I have the access of whm. Can I edit the ssd file from there
      – mynameisbutt
      Apr 10 at 20:11










    • Answer updated, you should be able to recover using those instructions.
      – Sebastian Stark
      Apr 10 at 20:15










    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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    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%2f1023771%2fpermission-denied-please-try-again-ssh-error%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    Also note: the AllowUsers specifies that login is allowed only for those user names that match a pattern listed with this keyword. By default, login is allowed for all user names. So, with your configuration, john is the only user that can log in using ssh.



    The answer from Sebastian Stark is also correct: root would not be able to login by default, even if you had included root in AllowUsers.



    So: I recommend, first, making sure that user john can login correctly. Make sure that john has a shell assigned in /etc/passwd and give him one using chsh if necessary. Then, login as john and use sudo if you need root access.






    share|improve this answer


























      up vote
      1
      down vote













      Also note: the AllowUsers specifies that login is allowed only for those user names that match a pattern listed with this keyword. By default, login is allowed for all user names. So, with your configuration, john is the only user that can log in using ssh.



      The answer from Sebastian Stark is also correct: root would not be able to login by default, even if you had included root in AllowUsers.



      So: I recommend, first, making sure that user john can login correctly. Make sure that john has a shell assigned in /etc/passwd and give him one using chsh if necessary. Then, login as john and use sudo if you need root access.






      share|improve this answer
























        up vote
        1
        down vote










        up vote
        1
        down vote









        Also note: the AllowUsers specifies that login is allowed only for those user names that match a pattern listed with this keyword. By default, login is allowed for all user names. So, with your configuration, john is the only user that can log in using ssh.



        The answer from Sebastian Stark is also correct: root would not be able to login by default, even if you had included root in AllowUsers.



        So: I recommend, first, making sure that user john can login correctly. Make sure that john has a shell assigned in /etc/passwd and give him one using chsh if necessary. Then, login as john and use sudo if you need root access.






        share|improve this answer














        Also note: the AllowUsers specifies that login is allowed only for those user names that match a pattern listed with this keyword. By default, login is allowed for all user names. So, with your configuration, john is the only user that can log in using ssh.



        The answer from Sebastian Stark is also correct: root would not be able to login by default, even if you had included root in AllowUsers.



        So: I recommend, first, making sure that user john can login correctly. Make sure that john has a shell assigned in /etc/passwd and give him one using chsh if necessary. Then, login as john and use sudo if you need root access.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 10 at 19:49

























        answered Apr 10 at 19:44









        Martin W

        74238




        74238






















            up vote
            1
            down vote













            By default, logging in as root using password is disabled. You should change the PermitRootLogin setting in /etc/ssh/sshd_config accordingly to allow that, if it is what you want. Alternatively set up public key authentication for the root account. See e. g. How to set up passwordless SSH access for root user for an example. Unfortunately this will be impossible to do without help from your hoster if you really locked yourself out and logging in as john also does not work.



            In addition to this, if you do not add root to the AllowUser directive as well, the setting of PermitRootLogin will have no effect anyway.



            So to fix your particular problem make those two settings in sshd_config look like this:



            PermitRootLogin yes
            AllowUsers root john


            and then restart sshd or reboot the server. Afterwards you should be able to log in as root using a password.



            As for the error message when you are trying to log in as john: This does not look like a normal ssh or Ubuntu error message but rather something your hoster added. You should probably do what it says and contact support.



            Safety measures



            In general, if you are messing with sshd settings there is an easy way to test things: Simply restart the sshd service using service ssh restart and try things out from another terminal. Do not terminate your existing session. If something goes wrong you still have the running session and can revert the wrong settings.



            Rebooting the whole server is never necessary for activating changes to sshd.






            share|improve this answer






















            • I have the access of whm. Can I edit the ssd file from there
              – mynameisbutt
              Apr 10 at 20:11










            • Answer updated, you should be able to recover using those instructions.
              – Sebastian Stark
              Apr 10 at 20:15














            up vote
            1
            down vote













            By default, logging in as root using password is disabled. You should change the PermitRootLogin setting in /etc/ssh/sshd_config accordingly to allow that, if it is what you want. Alternatively set up public key authentication for the root account. See e. g. How to set up passwordless SSH access for root user for an example. Unfortunately this will be impossible to do without help from your hoster if you really locked yourself out and logging in as john also does not work.



            In addition to this, if you do not add root to the AllowUser directive as well, the setting of PermitRootLogin will have no effect anyway.



            So to fix your particular problem make those two settings in sshd_config look like this:



            PermitRootLogin yes
            AllowUsers root john


            and then restart sshd or reboot the server. Afterwards you should be able to log in as root using a password.



            As for the error message when you are trying to log in as john: This does not look like a normal ssh or Ubuntu error message but rather something your hoster added. You should probably do what it says and contact support.



            Safety measures



            In general, if you are messing with sshd settings there is an easy way to test things: Simply restart the sshd service using service ssh restart and try things out from another terminal. Do not terminate your existing session. If something goes wrong you still have the running session and can revert the wrong settings.



            Rebooting the whole server is never necessary for activating changes to sshd.






            share|improve this answer






















            • I have the access of whm. Can I edit the ssd file from there
              – mynameisbutt
              Apr 10 at 20:11










            • Answer updated, you should be able to recover using those instructions.
              – Sebastian Stark
              Apr 10 at 20:15












            up vote
            1
            down vote










            up vote
            1
            down vote









            By default, logging in as root using password is disabled. You should change the PermitRootLogin setting in /etc/ssh/sshd_config accordingly to allow that, if it is what you want. Alternatively set up public key authentication for the root account. See e. g. How to set up passwordless SSH access for root user for an example. Unfortunately this will be impossible to do without help from your hoster if you really locked yourself out and logging in as john also does not work.



            In addition to this, if you do not add root to the AllowUser directive as well, the setting of PermitRootLogin will have no effect anyway.



            So to fix your particular problem make those two settings in sshd_config look like this:



            PermitRootLogin yes
            AllowUsers root john


            and then restart sshd or reboot the server. Afterwards you should be able to log in as root using a password.



            As for the error message when you are trying to log in as john: This does not look like a normal ssh or Ubuntu error message but rather something your hoster added. You should probably do what it says and contact support.



            Safety measures



            In general, if you are messing with sshd settings there is an easy way to test things: Simply restart the sshd service using service ssh restart and try things out from another terminal. Do not terminate your existing session. If something goes wrong you still have the running session and can revert the wrong settings.



            Rebooting the whole server is never necessary for activating changes to sshd.






            share|improve this answer














            By default, logging in as root using password is disabled. You should change the PermitRootLogin setting in /etc/ssh/sshd_config accordingly to allow that, if it is what you want. Alternatively set up public key authentication for the root account. See e. g. How to set up passwordless SSH access for root user for an example. Unfortunately this will be impossible to do without help from your hoster if you really locked yourself out and logging in as john also does not work.



            In addition to this, if you do not add root to the AllowUser directive as well, the setting of PermitRootLogin will have no effect anyway.



            So to fix your particular problem make those two settings in sshd_config look like this:



            PermitRootLogin yes
            AllowUsers root john


            and then restart sshd or reboot the server. Afterwards you should be able to log in as root using a password.



            As for the error message when you are trying to log in as john: This does not look like a normal ssh or Ubuntu error message but rather something your hoster added. You should probably do what it says and contact support.



            Safety measures



            In general, if you are messing with sshd settings there is an easy way to test things: Simply restart the sshd service using service ssh restart and try things out from another terminal. Do not terminate your existing session. If something goes wrong you still have the running session and can revert the wrong settings.



            Rebooting the whole server is never necessary for activating changes to sshd.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 10 at 20:15

























            answered Apr 10 at 19:41









            Sebastian Stark

            4,708938




            4,708938











            • I have the access of whm. Can I edit the ssd file from there
              – mynameisbutt
              Apr 10 at 20:11










            • Answer updated, you should be able to recover using those instructions.
              – Sebastian Stark
              Apr 10 at 20:15
















            • I have the access of whm. Can I edit the ssd file from there
              – mynameisbutt
              Apr 10 at 20:11










            • Answer updated, you should be able to recover using those instructions.
              – Sebastian Stark
              Apr 10 at 20:15















            I have the access of whm. Can I edit the ssd file from there
            – mynameisbutt
            Apr 10 at 20:11




            I have the access of whm. Can I edit the ssd file from there
            – mynameisbutt
            Apr 10 at 20:11












            Answer updated, you should be able to recover using those instructions.
            – Sebastian Stark
            Apr 10 at 20:15




            Answer updated, you should be able to recover using those instructions.
            – Sebastian Stark
            Apr 10 at 20:15

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1023771%2fpermission-denied-please-try-again-ssh-error%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Trouble downloading packages list due to a “Hash sum mismatch” error

            How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

            How do I move numbers in filenames, in a batch renaming operation?