SELinux: running a custom shell binary from /etc/passwdVlc Media Problem in Fedora!How do I configure SELinux...

Expenditure in Poland - Forex doesn't have Zloty

Asking bank to reduce APR instead of increasing credit limit

What is the probability of having a pair of doubles when throwing dice?

Where can I find the list of all tendons in the human body?

What are the slash markings on Gatwick's 08R/26L?

What does it mean when you think without speaking?

What are the problems in teaching guitar via Skype?

What was this black-and-white film set in the Arctic or Antarctic where the monster/alien gets fried in the end?

Does `declare -a A` create an empty array `A` in Bash?

Infinitely many hats

What is the intuition behind uniform continuity?

Thousands and thousands of words

The deliberate use of misleading terminology

Term for checking piece whose opponent daren't capture it

Adding strings in lists together

What is the indigenous Russian word for a wild boar?

SPI on stm32 won't work without pullup resistors and even then performs poorly

Can I install a row of bricks on a slab to support a shed?

Mother abusing my finances

Draw a checker pattern with a black X in the center

Is there an evolutionary advantage to having two heads?

Are there regional foods in Westeros?

What does the behaviour of water on the skin of an aircraft in flight tell us?

Lunar orbital rendezvous



SELinux: running a custom shell binary from /etc/passwd


Vlc Media Problem in Fedora!How do I configure SELinux to allow outbound connections from a CGI script?How to get Wine to work with SELinux?Gnome terminal fails to startSELinux: determine directory of denied file creationselinux started blocking php “exec” calls after yum updateSELinux Prevents httpd Write FilesHow do I differentiate between, xterm and firefox, if both call syscall=socketcall(recvmsg)Cannot stop SELinux from blocking Apache accessing /usr/local/nagios/var/rw/nagios.cmdAllow certain risky behaviour of a single program in a safe way in SELinux






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







0















----- Problem --------



I have CentOS 7.6 running on my system. I want to invoke a custom shell instead of standard shell in the /etc/passwd file.



I have SELinux enabled, and for some reason sshd_t domain does not get transitioned to a new custom domain that my custom shell holds.



Something like this:



In /etc/passwd:
root:x:0:0:root:/root:/bin/myshell



SELinux domain transition:



myshell.fc



/bin/myshell                             gen_context(system_u:object_r:myshell_exec_t,s0)


myshell.te



role unconfined_r types myshell_t;
role_transition unconfined_r myshell_t system_r;
domtrans_pattern(sshd_t, myshell_exec_t, myshell_t)


The default user is unconfined_u:unconfined_r:unconfined_t.



I also have a role transition from unconfined_r to system_r.



---- Issue ------



For some reason sshd_t does not get transitioned into myshell_t domain.
User is root.



Here is the role change log message:



type=USER_ROLE_CHANGE msg=audit(1559079004.637:339116): pid=24478 uid=0 auid=0 ses=823 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='pam: default-context=system_u:unconfined_r:unconfined_t:s0 selected-context=system_u:unconfined_r:unconfined_t:s0 exe="/usr/sbin/sshd" hostname=X.X.X.X addr=X.X.X.X terminal=ssh res=success'

type=AVC msg=audit(1559067681.085:327703): avc: granted { execute } for pid=17593 comm="sshd" name="myshell" scontext=system_u:unconfined_r:unconfined_t:s0 tcontext=system_u:object_r:myshell_exec_t:s0 tclass=file


It does execute the binary but the transition is not happening. Probably because the role is different, but I do have role transition not sure why is it not working though.










share|improve this question









New contributor



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


























    0















    ----- Problem --------



    I have CentOS 7.6 running on my system. I want to invoke a custom shell instead of standard shell in the /etc/passwd file.



    I have SELinux enabled, and for some reason sshd_t domain does not get transitioned to a new custom domain that my custom shell holds.



    Something like this:



    In /etc/passwd:
    root:x:0:0:root:/root:/bin/myshell



    SELinux domain transition:



    myshell.fc



    /bin/myshell                             gen_context(system_u:object_r:myshell_exec_t,s0)


    myshell.te



    role unconfined_r types myshell_t;
    role_transition unconfined_r myshell_t system_r;
    domtrans_pattern(sshd_t, myshell_exec_t, myshell_t)


    The default user is unconfined_u:unconfined_r:unconfined_t.



    I also have a role transition from unconfined_r to system_r.



    ---- Issue ------



    For some reason sshd_t does not get transitioned into myshell_t domain.
    User is root.



    Here is the role change log message:



    type=USER_ROLE_CHANGE msg=audit(1559079004.637:339116): pid=24478 uid=0 auid=0 ses=823 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='pam: default-context=system_u:unconfined_r:unconfined_t:s0 selected-context=system_u:unconfined_r:unconfined_t:s0 exe="/usr/sbin/sshd" hostname=X.X.X.X addr=X.X.X.X terminal=ssh res=success'

    type=AVC msg=audit(1559067681.085:327703): avc: granted { execute } for pid=17593 comm="sshd" name="myshell" scontext=system_u:unconfined_r:unconfined_t:s0 tcontext=system_u:object_r:myshell_exec_t:s0 tclass=file


    It does execute the binary but the transition is not happening. Probably because the role is different, but I do have role transition not sure why is it not working though.










    share|improve this question









    New contributor



    np08 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








      ----- Problem --------



      I have CentOS 7.6 running on my system. I want to invoke a custom shell instead of standard shell in the /etc/passwd file.



      I have SELinux enabled, and for some reason sshd_t domain does not get transitioned to a new custom domain that my custom shell holds.



      Something like this:



      In /etc/passwd:
      root:x:0:0:root:/root:/bin/myshell



      SELinux domain transition:



      myshell.fc



      /bin/myshell                             gen_context(system_u:object_r:myshell_exec_t,s0)


      myshell.te



      role unconfined_r types myshell_t;
      role_transition unconfined_r myshell_t system_r;
      domtrans_pattern(sshd_t, myshell_exec_t, myshell_t)


      The default user is unconfined_u:unconfined_r:unconfined_t.



      I also have a role transition from unconfined_r to system_r.



      ---- Issue ------



      For some reason sshd_t does not get transitioned into myshell_t domain.
      User is root.



      Here is the role change log message:



      type=USER_ROLE_CHANGE msg=audit(1559079004.637:339116): pid=24478 uid=0 auid=0 ses=823 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='pam: default-context=system_u:unconfined_r:unconfined_t:s0 selected-context=system_u:unconfined_r:unconfined_t:s0 exe="/usr/sbin/sshd" hostname=X.X.X.X addr=X.X.X.X terminal=ssh res=success'

      type=AVC msg=audit(1559067681.085:327703): avc: granted { execute } for pid=17593 comm="sshd" name="myshell" scontext=system_u:unconfined_r:unconfined_t:s0 tcontext=system_u:object_r:myshell_exec_t:s0 tclass=file


      It does execute the binary but the transition is not happening. Probably because the role is different, but I do have role transition not sure why is it not working though.










      share|improve this question









      New contributor



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











      ----- Problem --------



      I have CentOS 7.6 running on my system. I want to invoke a custom shell instead of standard shell in the /etc/passwd file.



      I have SELinux enabled, and for some reason sshd_t domain does not get transitioned to a new custom domain that my custom shell holds.



      Something like this:



      In /etc/passwd:
      root:x:0:0:root:/root:/bin/myshell



      SELinux domain transition:



      myshell.fc



      /bin/myshell                             gen_context(system_u:object_r:myshell_exec_t,s0)


      myshell.te



      role unconfined_r types myshell_t;
      role_transition unconfined_r myshell_t system_r;
      domtrans_pattern(sshd_t, myshell_exec_t, myshell_t)


      The default user is unconfined_u:unconfined_r:unconfined_t.



      I also have a role transition from unconfined_r to system_r.



      ---- Issue ------



      For some reason sshd_t does not get transitioned into myshell_t domain.
      User is root.



      Here is the role change log message:



      type=USER_ROLE_CHANGE msg=audit(1559079004.637:339116): pid=24478 uid=0 auid=0 ses=823 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='pam: default-context=system_u:unconfined_r:unconfined_t:s0 selected-context=system_u:unconfined_r:unconfined_t:s0 exe="/usr/sbin/sshd" hostname=X.X.X.X addr=X.X.X.X terminal=ssh res=success'

      type=AVC msg=audit(1559067681.085:327703): avc: granted { execute } for pid=17593 comm="sshd" name="myshell" scontext=system_u:unconfined_r:unconfined_t:s0 tcontext=system_u:object_r:myshell_exec_t:s0 tclass=file


      It does execute the binary but the transition is not happening. Probably because the role is different, but I do have role transition not sure why is it not working though.







      linux centos selinux






      share|improve this question









      New contributor



      np08 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



      np08 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 37 mins ago









      Rui F Ribeiro

      42.6k1688147




      42.6k1688147






      New contributor



      np08 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









      np08np08

      41




      41




      New contributor



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




      New contributor




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
























          0






          active

          oldest

          votes












          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
          });


          }
          });






          np08 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%2f521624%2fselinux-running-a-custom-shell-binary-from-etc-passwd%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








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










          draft saved

          draft discarded


















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













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












          np08 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%2f521624%2fselinux-running-a-custom-shell-binary-from-etc-passwd%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

          Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

          The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

          Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...