1 2 | dd if=/dev/zero of=f8.img bs=1G seek=10 count=1 qemu -hda f8.img -cdrom f8.iso -boot d -m 1024 -vnc 3 |
1 | vncviewer :3 |
1 | killall -9 yum-updatesd |
1 | yum install selinux-policy-devel.noarch |
1 2 3 4 5 6 7 | cd /usr/share/selinux/ cp -r devel cash_register cd cash_register rm example.* tar zxf ~myuser/cash_register_f8.tgz mv register.py /bin make |
1 | semodule -i cash_register.pp |
1 2 3 4 | adduser bob adduser mary passwd bob passwd mary |
1 2 3 4 5 | semanage user -a -R cashier_r -P cashier bob_u semanage login -a -s bob_u bob semanage user -a -R mgr_r -P mgr mary_u semanage login -a -s mary_u mary |
1 2 3 4 5 6 7 | mkdir /data mkdir /data/final mkdir /data/cashier_r mkdir /data/mgr_r chmod 777 /data/cashier_r chmod 777 /data/mgr_r chmod 777 /data/final |
1 | fixfiles -f relabel /data /bin/register.py /home |
1 2 3 4 | adduser charlie passwd charlie semanage user -a -R mgr_r -R cashier_r -P mgr charlie_u semanage login -a -s charlie_u charlie |
1 | session required pam_selinux.so open |
1 | session required pam_selinux.so open select_context |
1 2 | echo "cashier_r:cashier_t" >> \ /etc/selinux/targeted/contexts/default_type |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |