
• $ apt-get install ssh
• $ apt-get install apache2
• apt-get install policycoreutils
• $ apt-get install selinux-utils
• $ apt-get install selinux-basics
2. Reboot the board to u-boot prompt, add parameters "security=selinux selinux=1 enforcing=0" to bootargs (ls1028ardb as
example)
=> setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rootwait rw earlycon=uart8250,0x21c0500
console=ttyS0,115200 cma=256M video=1920x1080-32@60 security=selinux selinux=1
enforcing=0;mmcinfo;fatload mmc 0:1 ${dp_load} ${dp_file}; hdp load ${dp_load} $
{dp_offset};fatload mmc 0:1 ${loadaddr} ${bootfile};fatload mmc 0:1 ${fdtaddr} ${fdtfile};booti $
{loadaddr} - ${fdtaddr}'
4.7.1.3 Basic setup
Perform the following basic steps before running the SELlinux demo.
1. Map root to sysadm_u, modify the mapping of root and selinux user:
$ semanage login -m -s sysadm_u root
Logout and login again. Check root’s SELinux login user:
$ id -Z
sysadm_u:sysadm_r:sysadm_t:s0
2. Map linux user to a selinux user named user_u:
$ semanage login -m -s user_u __default__
Check all the selinux users logged in:
$ semanage login -l
Login Name SELinux User MLS/MCS Range Service
__default__ user_u s0 *
root sysadm_u s0 *
system_u system_u s0-s0:c0.c1023 *
3. Label the system. Modify the SELinux config file with
SELINUXTYPE=default
using the command below:
$ vim /etc/selinux/config
Restore the type of files in /root:
$ semanage fcontext -a -t home_root_t '/root(/.*)?'
4. Check ssh server after the kernel boots up:
$ systemctl status ssh
ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled) Active: active
(running) since 2017-05-09 07:23:56 CST; 1 weeks 6 days ago
Main PID: 908 (sshd)
NXP Semiconductors
Industrial features
Open Industrial User Guide, Rev. 1.8, 05/2020
User's Guide
60 / 199