ssh_selinux_change_context: setcon failed with Invalid argument

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





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
0
down vote

favorite












I am trying to do ssh communication to an IP but I get the following error messages in logs.



Jun 5 11:36:50 thetemplate my-sshd[26346]: Accepted password for user1 from 172.80.1.2 port 34278 ssh2
Jun 5 11:36:50 thetemplate my-sshd[26346]: User child is on pid 27078
Jun 5 11:36:50 thetemplate my-sshd[27078]: ssh_selinux_change_context: setcon failed with Invalid argument
Jun 5 11:36:50 thetemplate my-sshd[27078]: Changed root directory to "/test//ssh/home/user1"
Jun 5 11:36:50 thetemplate my-sshd[26346]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument


According to this answer, I tried changing the context for my-sshd by doing



chcon system_u:object_r:sshd_exec_t:s0 /test/bin/my-sshd
service sshd restart


The error messages still comes in /var/log/messages while doing ssh.



On doing ps -eZ | grep sshd I see that my-sshd has a different context to /usr/sbin/sshd



unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 24012 ? 00:00:00 sshd
unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 24272 ? 00:00:00 sshd
unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 29923 ? 00:00:00 sshd
unconfined_u:unconfined_r:unconfined_java_t:s0-s0:c0.c1023 32487 ? 00:00:00 my-sshd


Could this be the reason for these error messages, if yes how to proceed with this? Any guidance is much appreciated.







share|improve this question

























    up vote
    0
    down vote

    favorite












    I am trying to do ssh communication to an IP but I get the following error messages in logs.



    Jun 5 11:36:50 thetemplate my-sshd[26346]: Accepted password for user1 from 172.80.1.2 port 34278 ssh2
    Jun 5 11:36:50 thetemplate my-sshd[26346]: User child is on pid 27078
    Jun 5 11:36:50 thetemplate my-sshd[27078]: ssh_selinux_change_context: setcon failed with Invalid argument
    Jun 5 11:36:50 thetemplate my-sshd[27078]: Changed root directory to "/test//ssh/home/user1"
    Jun 5 11:36:50 thetemplate my-sshd[26346]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument


    According to this answer, I tried changing the context for my-sshd by doing



    chcon system_u:object_r:sshd_exec_t:s0 /test/bin/my-sshd
    service sshd restart


    The error messages still comes in /var/log/messages while doing ssh.



    On doing ps -eZ | grep sshd I see that my-sshd has a different context to /usr/sbin/sshd



    unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 24012 ? 00:00:00 sshd
    unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 24272 ? 00:00:00 sshd
    unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 29923 ? 00:00:00 sshd
    unconfined_u:unconfined_r:unconfined_java_t:s0-s0:c0.c1023 32487 ? 00:00:00 my-sshd


    Could this be the reason for these error messages, if yes how to proceed with this? Any guidance is much appreciated.







    share|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to do ssh communication to an IP but I get the following error messages in logs.



      Jun 5 11:36:50 thetemplate my-sshd[26346]: Accepted password for user1 from 172.80.1.2 port 34278 ssh2
      Jun 5 11:36:50 thetemplate my-sshd[26346]: User child is on pid 27078
      Jun 5 11:36:50 thetemplate my-sshd[27078]: ssh_selinux_change_context: setcon failed with Invalid argument
      Jun 5 11:36:50 thetemplate my-sshd[27078]: Changed root directory to "/test//ssh/home/user1"
      Jun 5 11:36:50 thetemplate my-sshd[26346]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument


      According to this answer, I tried changing the context for my-sshd by doing



      chcon system_u:object_r:sshd_exec_t:s0 /test/bin/my-sshd
      service sshd restart


      The error messages still comes in /var/log/messages while doing ssh.



      On doing ps -eZ | grep sshd I see that my-sshd has a different context to /usr/sbin/sshd



      unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 24012 ? 00:00:00 sshd
      unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 24272 ? 00:00:00 sshd
      unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 29923 ? 00:00:00 sshd
      unconfined_u:unconfined_r:unconfined_java_t:s0-s0:c0.c1023 32487 ? 00:00:00 my-sshd


      Could this be the reason for these error messages, if yes how to proceed with this? Any guidance is much appreciated.







      share|improve this question











      I am trying to do ssh communication to an IP but I get the following error messages in logs.



      Jun 5 11:36:50 thetemplate my-sshd[26346]: Accepted password for user1 from 172.80.1.2 port 34278 ssh2
      Jun 5 11:36:50 thetemplate my-sshd[26346]: User child is on pid 27078
      Jun 5 11:36:50 thetemplate my-sshd[27078]: ssh_selinux_change_context: setcon failed with Invalid argument
      Jun 5 11:36:50 thetemplate my-sshd[27078]: Changed root directory to "/test//ssh/home/user1"
      Jun 5 11:36:50 thetemplate my-sshd[26346]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument


      According to this answer, I tried changing the context for my-sshd by doing



      chcon system_u:object_r:sshd_exec_t:s0 /test/bin/my-sshd
      service sshd restart


      The error messages still comes in /var/log/messages while doing ssh.



      On doing ps -eZ | grep sshd I see that my-sshd has a different context to /usr/sbin/sshd



      unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 24012 ? 00:00:00 sshd
      unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 24272 ? 00:00:00 sshd
      unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 29923 ? 00:00:00 sshd
      unconfined_u:unconfined_r:unconfined_java_t:s0-s0:c0.c1023 32487 ? 00:00:00 my-sshd


      Could this be the reason for these error messages, if yes how to proceed with this? Any guidance is much appreciated.









      share|improve this question










      share|improve this question




      share|improve this question









      asked Aug 3 at 10:54









      rayindrane2l

      61




      61




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Use command



          audit2allow -w -a


          and at the bottom of output You have got linux command what to use for resolve Your problem.






          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%2f460296%2fssh-selinux-change-context-setcon-failed-with-invalid-argument%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
            0
            down vote













            Use command



            audit2allow -w -a


            and at the bottom of output You have got linux command what to use for resolve Your problem.






            share|improve this answer

























              up vote
              0
              down vote













              Use command



              audit2allow -w -a


              and at the bottom of output You have got linux command what to use for resolve Your problem.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                Use command



                audit2allow -w -a


                and at the bottom of output You have got linux command what to use for resolve Your problem.






                share|improve this answer













                Use command



                audit2allow -w -a


                and at the bottom of output You have got linux command what to use for resolve Your problem.







                share|improve this answer













                share|improve this answer



                share|improve this answer











                answered Aug 3 at 14:14









                debek

                208




                208






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460296%2fssh-selinux-change-context-setcon-failed-with-invalid-argument%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?

                    Christian Cage

                    How to properly install USB display driver for Fresco Logic FL2000DX on Ubuntu?