LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-04-2022, 06:47 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 128

Rep: Reputation: 6
Question initrc_t bash: /etc/init.d/network: /bin/bash: bad interpreter: Permission denied


Hello, on my CentOS 7.6 with SELinux enforcing I faced with the issue:

Code:
# id
uid=0(root) gid=0(root) groups=0(root) context=sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023

#ls -lZ /etc/init.d/network
-rwxr-x---. root root system_u:object_r:initrc_exec_t:s0 /etc/init.d/network

#  /etc/init.d/network
bash: /etc/init.d/network: /bin/bash: bad interpreter: Permission denied

# sh /etc/init.d/network
Usage: /etc/init.d/network {start|stop|status|restart|force-reload}


# runcon -r sysadm_r /etc/init.d/network
Usage: /etc/init.d/network {start|stop|status|restart|force-reload}
So, it looks like some restriction doesn't allow to execute files with initrc_exec_t type.
Any Ideas of how to fix that?

Last edited by sluge; 02-04-2022 at 06:53 AM.
 
Old 02-04-2022, 06:57 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
What is the output of getsebool sysadm_exec_content?

Are there local policy customization that can be shown with
Code:
semanage user -lC
or with
Code:
semanage login -lC

Last edited by shruggy; 02-04-2022 at 07:46 AM.
 
Old 02-04-2022, 08:49 AM   #3
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 128

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by shruggy View Post
What is the output of getsebool sysadm_exec_content?

Are there local policy customization that can be shown with
Code:
semanage user -lC
or with
Code:
semanage login -lC
Yes, a bit:
Code:
 semanage login -lC

Login Name           SELinux User         MLS/MCS Range        Service

__default__          user_u               s0                   *
sluge                sysadm_u             s0-s0:c0.c1023       *
 
  


Reply

Tags
selinux



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/usr/bin/env: bad interpreter: Permission denied Master Fox Linux - Software 8 02-09-2012 08:25 AM
-bash: ./configure: /bin/sh: bad interpreter: Permission denied cwwilson721 Slackware 28 12-25-2010 04:11 AM
/bin/bash: bad interpreter: Permission denied cap_ahab Linux - General 4 01-17-2006 08:11 AM
Selinux, ./INSTALL: /bin/sh: bad interpreter: Permission denied TomF Linux - Security 2 12-08-2004 11:36 AM
/bin/sh: bad interpreter: Permission denied linmix Linux - Software 12 08-16-2004 06:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration