vim /etc/sysconfig/selinux
selinux 的配置文件 SELINUX=enforcing selinux 开启 SELINUX=disabled selinux 关闭getenforce
查看 selinux 状态
[root@dchxmj linux1]# ls file1 linux1file1 pub [root@dchxmj linux1]# ls -Z -rw-r--r-- root root ? file1 -rw-r--r-- root root ? linux1file1 drwxrwxr-x root root ? pub [root@dchxmj linux1]#测试:
lftp IP -u username
[kiosk@foundation30 Desktop]$ lftp 172.25.254.130 -u linux1 Password: lftp linux1@172.25.254.130:~> ls -rw-r--r-- 1 0 0 0 Feb 21 08:50 file1 -rw-r--r-- 1 0 0 0 Feb 21 07:40 linux1file1 drwxrwxr-x 2 0 0 6 Feb 21 08:28 pub #所有文件都可以访问到 lftp linux1@172.25.254.130:/> ls -Z -rw-r--r-- 1 0 0 0 Feb 21 08:50 file1 -rw-r--r-- 1 0 0 0 Feb 21 07:40 linux1file1 drwxrwxr-x 2 0 0 6 Feb 21 08:28 pub lftp linux1@172.25.254.130:/> exit [kiosk@foundation30 Desktop]$测试:
[kiosk@foundation30 Desktop]$ lftp 172.25.254.130 lftp 172.25.254.130:~> ls drwxr-xr-x 3 0 0 43 Feb 21 09:07 pub lftp 172.25.254.130:/> cd pub/ lftp 172.25.254.130:/pub> ls drwxr-xr-x 2 0 0 6 Feb 21 09:04 linux -rw-r--r-- 1 0 0 0 Feb 21 09:05 linux1 lftp 172.25.254.130:/pub> exit [kiosk@foundation30 Desktop]$>
cat /var/log/audit/audit.log #默认位置 setroubleshoot-server.x86_64 ###可以将/var/log/audit/audit.log里面的日志经过处理存放到/var/log/messages>
[root@localhost ~]# yum search setroubleshoot Loaded plugins: langpacks ========================= N/S matched: setroubleshoot ========================== setroubleshoot-plugins.noarch : Analysis plugins for use with setroubleshoot setroubleshoot.x86_64 : Helps troubleshoot SELinux problems setroubleshoot-server.x86_64 : SELinux troubleshoot server Name and summary matches only, use "search all" for everything. [root@localhost ~]# yum install setroubleshoot-server.x86_64 -y cat /var/log/audit/audit.log cat /var/log/messages