Can't start the SSH service in CentOS V6.9

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











up vote
-2
down vote

favorite












Currenlty ssh service is in stop status.when we trying to start this service following error shows;



'/etc/ssh/sshd_config line 23: directive 'protocol' is not allowed within a match block'.
enter image description here



How to fix this issue and start ths ssh service



Here is the first part of the config file:
enter image description here







share|improve this question





















  • Can you post your /etc/ssh/sshd_config? It looks like you need to end your match block before using the Protocol directive
    – rusty shackleford
    Jun 7 at 9:45






  • 1




    From the top of your screenshot to the Protocol 2 line, I count 19 lines, not 23. So is there anything that includes the word Match in the first 4 lines that are not visible? (In an unedited /etc/ssh/sshd_config file from RHEL 6.9, that Protocol 2line seems to be line 21, not 23. So it looks like this file has been edited at some point.)
    – telcoM
    Jun 7 at 9:56










  • @rusty shackleford : sorry can't get the entire data beacuse we can not login to the server.Only can access via vnc.
    – Indika Kulasighe
    Jun 7 at 10:37










  • @telcoM I have attached the first part of the ssh config file..
    – Indika Kulasighe
    Jun 7 at 10:40










  • I have comment first to lines.It works for me.
    – Indika Kulasighe
    Jun 7 at 10:54














up vote
-2
down vote

favorite












Currenlty ssh service is in stop status.when we trying to start this service following error shows;



'/etc/ssh/sshd_config line 23: directive 'protocol' is not allowed within a match block'.
enter image description here



How to fix this issue and start ths ssh service



Here is the first part of the config file:
enter image description here







share|improve this question





















  • Can you post your /etc/ssh/sshd_config? It looks like you need to end your match block before using the Protocol directive
    – rusty shackleford
    Jun 7 at 9:45






  • 1




    From the top of your screenshot to the Protocol 2 line, I count 19 lines, not 23. So is there anything that includes the word Match in the first 4 lines that are not visible? (In an unedited /etc/ssh/sshd_config file from RHEL 6.9, that Protocol 2line seems to be line 21, not 23. So it looks like this file has been edited at some point.)
    – telcoM
    Jun 7 at 9:56










  • @rusty shackleford : sorry can't get the entire data beacuse we can not login to the server.Only can access via vnc.
    – Indika Kulasighe
    Jun 7 at 10:37










  • @telcoM I have attached the first part of the ssh config file..
    – Indika Kulasighe
    Jun 7 at 10:40










  • I have comment first to lines.It works for me.
    – Indika Kulasighe
    Jun 7 at 10:54












up vote
-2
down vote

favorite









up vote
-2
down vote

favorite











Currenlty ssh service is in stop status.when we trying to start this service following error shows;



'/etc/ssh/sshd_config line 23: directive 'protocol' is not allowed within a match block'.
enter image description here



How to fix this issue and start ths ssh service



Here is the first part of the config file:
enter image description here







share|improve this question













Currenlty ssh service is in stop status.when we trying to start this service following error shows;



'/etc/ssh/sshd_config line 23: directive 'protocol' is not allowed within a match block'.
enter image description here



How to fix this issue and start ths ssh service



Here is the first part of the config file:
enter image description here









share|improve this question












share|improve this question




share|improve this question








edited Jun 7 at 10:39
























asked Jun 7 at 9:42









Indika Kulasighe

11




11











  • Can you post your /etc/ssh/sshd_config? It looks like you need to end your match block before using the Protocol directive
    – rusty shackleford
    Jun 7 at 9:45






  • 1




    From the top of your screenshot to the Protocol 2 line, I count 19 lines, not 23. So is there anything that includes the word Match in the first 4 lines that are not visible? (In an unedited /etc/ssh/sshd_config file from RHEL 6.9, that Protocol 2line seems to be line 21, not 23. So it looks like this file has been edited at some point.)
    – telcoM
    Jun 7 at 9:56










  • @rusty shackleford : sorry can't get the entire data beacuse we can not login to the server.Only can access via vnc.
    – Indika Kulasighe
    Jun 7 at 10:37










  • @telcoM I have attached the first part of the ssh config file..
    – Indika Kulasighe
    Jun 7 at 10:40










  • I have comment first to lines.It works for me.
    – Indika Kulasighe
    Jun 7 at 10:54
















  • Can you post your /etc/ssh/sshd_config? It looks like you need to end your match block before using the Protocol directive
    – rusty shackleford
    Jun 7 at 9:45






  • 1




    From the top of your screenshot to the Protocol 2 line, I count 19 lines, not 23. So is there anything that includes the word Match in the first 4 lines that are not visible? (In an unedited /etc/ssh/sshd_config file from RHEL 6.9, that Protocol 2line seems to be line 21, not 23. So it looks like this file has been edited at some point.)
    – telcoM
    Jun 7 at 9:56










  • @rusty shackleford : sorry can't get the entire data beacuse we can not login to the server.Only can access via vnc.
    – Indika Kulasighe
    Jun 7 at 10:37










  • @telcoM I have attached the first part of the ssh config file..
    – Indika Kulasighe
    Jun 7 at 10:40










  • I have comment first to lines.It works for me.
    – Indika Kulasighe
    Jun 7 at 10:54















Can you post your /etc/ssh/sshd_config? It looks like you need to end your match block before using the Protocol directive
– rusty shackleford
Jun 7 at 9:45




Can you post your /etc/ssh/sshd_config? It looks like you need to end your match block before using the Protocol directive
– rusty shackleford
Jun 7 at 9:45




1




1




From the top of your screenshot to the Protocol 2 line, I count 19 lines, not 23. So is there anything that includes the word Match in the first 4 lines that are not visible? (In an unedited /etc/ssh/sshd_config file from RHEL 6.9, that Protocol 2line seems to be line 21, not 23. So it looks like this file has been edited at some point.)
– telcoM
Jun 7 at 9:56




From the top of your screenshot to the Protocol 2 line, I count 19 lines, not 23. So is there anything that includes the word Match in the first 4 lines that are not visible? (In an unedited /etc/ssh/sshd_config file from RHEL 6.9, that Protocol 2line seems to be line 21, not 23. So it looks like this file has been edited at some point.)
– telcoM
Jun 7 at 9:56












@rusty shackleford : sorry can't get the entire data beacuse we can not login to the server.Only can access via vnc.
– Indika Kulasighe
Jun 7 at 10:37




@rusty shackleford : sorry can't get the entire data beacuse we can not login to the server.Only can access via vnc.
– Indika Kulasighe
Jun 7 at 10:37












@telcoM I have attached the first part of the ssh config file..
– Indika Kulasighe
Jun 7 at 10:40




@telcoM I have attached the first part of the ssh config file..
– Indika Kulasighe
Jun 7 at 10:40












I have comment first to lines.It works for me.
– Indika Kulasighe
Jun 7 at 10:54




I have comment first to lines.It works for me.
– Indika Kulasighe
Jun 7 at 10:54










2 Answers
2






active

oldest

votes

















up vote
0
down vote













Add this on line 3:



Match all


You have not ended the Match block.






share|improve this answer





















  • I added this line but couldn't start ssh. I have comment those first two lines and start.It works. Anyway thanks for ur help.
    – Indika Kulasighe
    Jun 7 at 10:53

















up vote
0
down vote













The first two lines have apparently been added as part of a chroot jail set-up for user restricted_user_1.



Since that user is apparently related to system backups, I think it's kind of important... so a better solution would be to move those two lines to the end of the sshd_config file instead. That should both avoid the problem with the Protocol 2 line and not break the setup of restricted_user_1 user.



If you use Match blocks in sshd_config, then the ordering of lines in the file is important.



  • you should place any configuration lines that should be the default settings before any Match blocks. Some configuration options cannot be used within Match blocks: those options should always be placed before any Match block.

  • when a Match block begins, it will only end either at the start of another Match block or at end-of-file. A Match block can be used to conditionally override some of the default settings. Anything after the first Match block until end-of-file will belong to one Match block or another.





share|improve this answer





















    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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f448378%2fcant-start-the-ssh-service-in-centos-v6-9%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
    0
    down vote













    Add this on line 3:



    Match all


    You have not ended the Match block.






    share|improve this answer





















    • I added this line but couldn't start ssh. I have comment those first two lines and start.It works. Anyway thanks for ur help.
      – Indika Kulasighe
      Jun 7 at 10:53














    up vote
    0
    down vote













    Add this on line 3:



    Match all


    You have not ended the Match block.






    share|improve this answer





















    • I added this line but couldn't start ssh. I have comment those first two lines and start.It works. Anyway thanks for ur help.
      – Indika Kulasighe
      Jun 7 at 10:53












    up vote
    0
    down vote










    up vote
    0
    down vote









    Add this on line 3:



    Match all


    You have not ended the Match block.






    share|improve this answer













    Add this on line 3:



    Match all


    You have not ended the Match block.







    share|improve this answer













    share|improve this answer



    share|improve this answer











    answered Jun 7 at 10:45









    rusty shackleford

    1,135115




    1,135115











    • I added this line but couldn't start ssh. I have comment those first two lines and start.It works. Anyway thanks for ur help.
      – Indika Kulasighe
      Jun 7 at 10:53
















    • I added this line but couldn't start ssh. I have comment those first two lines and start.It works. Anyway thanks for ur help.
      – Indika Kulasighe
      Jun 7 at 10:53















    I added this line but couldn't start ssh. I have comment those first two lines and start.It works. Anyway thanks for ur help.
    – Indika Kulasighe
    Jun 7 at 10:53




    I added this line but couldn't start ssh. I have comment those first two lines and start.It works. Anyway thanks for ur help.
    – Indika Kulasighe
    Jun 7 at 10:53












    up vote
    0
    down vote













    The first two lines have apparently been added as part of a chroot jail set-up for user restricted_user_1.



    Since that user is apparently related to system backups, I think it's kind of important... so a better solution would be to move those two lines to the end of the sshd_config file instead. That should both avoid the problem with the Protocol 2 line and not break the setup of restricted_user_1 user.



    If you use Match blocks in sshd_config, then the ordering of lines in the file is important.



    • you should place any configuration lines that should be the default settings before any Match blocks. Some configuration options cannot be used within Match blocks: those options should always be placed before any Match block.

    • when a Match block begins, it will only end either at the start of another Match block or at end-of-file. A Match block can be used to conditionally override some of the default settings. Anything after the first Match block until end-of-file will belong to one Match block or another.





    share|improve this answer

























      up vote
      0
      down vote













      The first two lines have apparently been added as part of a chroot jail set-up for user restricted_user_1.



      Since that user is apparently related to system backups, I think it's kind of important... so a better solution would be to move those two lines to the end of the sshd_config file instead. That should both avoid the problem with the Protocol 2 line and not break the setup of restricted_user_1 user.



      If you use Match blocks in sshd_config, then the ordering of lines in the file is important.



      • you should place any configuration lines that should be the default settings before any Match blocks. Some configuration options cannot be used within Match blocks: those options should always be placed before any Match block.

      • when a Match block begins, it will only end either at the start of another Match block or at end-of-file. A Match block can be used to conditionally override some of the default settings. Anything after the first Match block until end-of-file will belong to one Match block or another.





      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        The first two lines have apparently been added as part of a chroot jail set-up for user restricted_user_1.



        Since that user is apparently related to system backups, I think it's kind of important... so a better solution would be to move those two lines to the end of the sshd_config file instead. That should both avoid the problem with the Protocol 2 line and not break the setup of restricted_user_1 user.



        If you use Match blocks in sshd_config, then the ordering of lines in the file is important.



        • you should place any configuration lines that should be the default settings before any Match blocks. Some configuration options cannot be used within Match blocks: those options should always be placed before any Match block.

        • when a Match block begins, it will only end either at the start of another Match block or at end-of-file. A Match block can be used to conditionally override some of the default settings. Anything after the first Match block until end-of-file will belong to one Match block or another.





        share|improve this answer













        The first two lines have apparently been added as part of a chroot jail set-up for user restricted_user_1.



        Since that user is apparently related to system backups, I think it's kind of important... so a better solution would be to move those two lines to the end of the sshd_config file instead. That should both avoid the problem with the Protocol 2 line and not break the setup of restricted_user_1 user.



        If you use Match blocks in sshd_config, then the ordering of lines in the file is important.



        • you should place any configuration lines that should be the default settings before any Match blocks. Some configuration options cannot be used within Match blocks: those options should always be placed before any Match block.

        • when a Match block begins, it will only end either at the start of another Match block or at end-of-file. A Match block can be used to conditionally override some of the default settings. Anything after the first Match block until end-of-file will belong to one Match block or another.






        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Jun 7 at 12:16









        telcoM

        10k11032




        10k11032






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448378%2fcant-start-the-ssh-service-in-centos-v6-9%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay