Error trying to restart ssh

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











up vote
1
down vote

favorite












I am using Linux Mint 18, the same distribution I have been using most of the semester for school. I was tasked with making certain adjustments to the sshd_config file, including chaning the listening port to 444, only allowing protocol 2, only allowing myself to login and not the other user named "otheraccount", not allowing root login, disabling the login of accounts with empty passwords, and creating a welcome banner. After using sudo and saving the sshd_config file, I go ahead and try to restart ssh using the sudo /etc/init.d/ssh restart but I get an error.



The error reads "Restarting ssh (via systemctl): ssh.serviceJob for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. Underneath this message it reads "failed!" in red lettering.










share|improve this question



















  • 3




    And what does it say for systemctl status ssh?
    – AlexP
    Dec 6 '16 at 16:53














up vote
1
down vote

favorite












I am using Linux Mint 18, the same distribution I have been using most of the semester for school. I was tasked with making certain adjustments to the sshd_config file, including chaning the listening port to 444, only allowing protocol 2, only allowing myself to login and not the other user named "otheraccount", not allowing root login, disabling the login of accounts with empty passwords, and creating a welcome banner. After using sudo and saving the sshd_config file, I go ahead and try to restart ssh using the sudo /etc/init.d/ssh restart but I get an error.



The error reads "Restarting ssh (via systemctl): ssh.serviceJob for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. Underneath this message it reads "failed!" in red lettering.










share|improve this question



















  • 3




    And what does it say for systemctl status ssh?
    – AlexP
    Dec 6 '16 at 16:53












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am using Linux Mint 18, the same distribution I have been using most of the semester for school. I was tasked with making certain adjustments to the sshd_config file, including chaning the listening port to 444, only allowing protocol 2, only allowing myself to login and not the other user named "otheraccount", not allowing root login, disabling the login of accounts with empty passwords, and creating a welcome banner. After using sudo and saving the sshd_config file, I go ahead and try to restart ssh using the sudo /etc/init.d/ssh restart but I get an error.



The error reads "Restarting ssh (via systemctl): ssh.serviceJob for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. Underneath this message it reads "failed!" in red lettering.










share|improve this question















I am using Linux Mint 18, the same distribution I have been using most of the semester for school. I was tasked with making certain adjustments to the sshd_config file, including chaning the listening port to 444, only allowing protocol 2, only allowing myself to login and not the other user named "otheraccount", not allowing root login, disabling the login of accounts with empty passwords, and creating a welcome banner. After using sudo and saving the sshd_config file, I go ahead and try to restart ssh using the sudo /etc/init.d/ssh restart but I get an error.



The error reads "Restarting ssh (via systemctl): ssh.serviceJob for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. Underneath this message it reads "failed!" in red lettering.







ssh linux-mint error-handling






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 40 mins ago









Rui F Ribeiro

37.3k1374118




37.3k1374118










asked Dec 6 '16 at 16:49









John

62




62







  • 3




    And what does it say for systemctl status ssh?
    – AlexP
    Dec 6 '16 at 16:53












  • 3




    And what does it say for systemctl status ssh?
    – AlexP
    Dec 6 '16 at 16:53







3




3




And what does it say for systemctl status ssh?
– AlexP
Dec 6 '16 at 16:53




And what does it say for systemctl status ssh?
– AlexP
Dec 6 '16 at 16:53










1 Answer
1






active

oldest

votes

















up vote
2
down vote













The problem in this case is SELinux (Security Enhanced Linux) which prevents the ssh running on that port.



To solve the problem use the following:



1) Change the type context for the ssh service using semanage as follow



semanage port -a -t ssh_port_t -p tcp 444


2) Restart ssh service



systemctl restart sshd && systemctl status sshd





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%2f328457%2ferror-trying-to-restart-ssh%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    The problem in this case is SELinux (Security Enhanced Linux) which prevents the ssh running on that port.



    To solve the problem use the following:



    1) Change the type context for the ssh service using semanage as follow



    semanage port -a -t ssh_port_t -p tcp 444


    2) Restart ssh service



    systemctl restart sshd && systemctl status sshd





    share|improve this answer


























      up vote
      2
      down vote













      The problem in this case is SELinux (Security Enhanced Linux) which prevents the ssh running on that port.



      To solve the problem use the following:



      1) Change the type context for the ssh service using semanage as follow



      semanage port -a -t ssh_port_t -p tcp 444


      2) Restart ssh service



      systemctl restart sshd && systemctl status sshd





      share|improve this answer
























        up vote
        2
        down vote










        up vote
        2
        down vote









        The problem in this case is SELinux (Security Enhanced Linux) which prevents the ssh running on that port.



        To solve the problem use the following:



        1) Change the type context for the ssh service using semanage as follow



        semanage port -a -t ssh_port_t -p tcp 444


        2) Restart ssh service



        systemctl restart sshd && systemctl status sshd





        share|improve this answer














        The problem in this case is SELinux (Security Enhanced Linux) which prevents the ssh running on that port.



        To solve the problem use the following:



        1) Change the type context for the ssh service using semanage as follow



        semanage port -a -t ssh_port_t -p tcp 444


        2) Restart ssh service



        systemctl restart sshd && systemctl status sshd






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 8 '16 at 10:45

























        answered Dec 6 '16 at 17:30









        Valentin Bajrami

        5,62111527




        5,62111527



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f328457%2ferror-trying-to-restart-ssh%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