| 查看手册页(man passwd)了解详细信息并使用以下命令: $ sudo passwd nemo<== change nemo's password$ sudo passwd -e dory   <== expire dory's password (forces her to reset it)$ sudo passwd -i shark  <== disable shark's account 
 pwck pwck命令对/etc/passwd和/etc/shadow文件进行完整性检查,确保存在必需的字段,存在文件和目录等。 $ sudo pwckuser 'squash': directory '/home/squash' does not existuser 'squash': program '/bin/bsh' does not exist 
 setfacl&getfacl 不要轻易显示rwxr-x ---类型权限,会让你想象这就是Linux系统上的文件权限。使用setfacl和getfacl命令,可以授予不是文件所有者且不是关联组(并且不希望它们)访问文件的成员。假设希望nemo具有对文件的读取权限,该文件概述了ufw设置说明文件,但仅此而已。 使用这样的命令修改文件的访问控制列表: $ setfacl -m u:nemo:r ufw-setup 
 然后getfacl命令将显示已进行的更改: $ getfacl ufw-setup# file: ufw-setup# owner: shs# group: shsuser::rwxuser:nemo:r--        <===group::rw-                      #effective:r--mask::r--other::--- 
 sestatus&apparmor sestatus和apparmor命令可以显示SELinux和apparmor工具的状态,这些工具使用强制访问控制在应用程序之间提供隔离。如果使用这些工具中的一个或另一个,应该知道如何显示其状态。 sestatus https://www.networkworld.com/article/3272286/open-source-tools/22-essential-security-commands-for-linux.html 
 apparmor $ sudo apparmor_statusapparmor module is loaded.18 profiles are loaded.18 profiles are in enforce mode.   /sbin/dhclient   /usr/bin/evince   /usr/bin/evince-previewer   /usr/bin/evince-previewer//sanitized_helper   /usr/bin/evince-thumbnailer   /usr/bin/evince-thumbnailer//sanitized_helper   /usr/bin/evince//sanitized_helper   /usr/lib/NetworkManager/nm-dhcp-client.action   /usr/lib/NetworkManager/nm-dhcp-helper   /usr/lib/connman/scripts/dhclient-script   /usr/lib/cups/backend/cups-pdf   /usr/lib/snapd/snap-confine   /usr/lib/snapd/snap-confine//mount-namespace-capture-helper   /usr/sbin/cups-browsed   /usr/sbin/cupsd   /usr/sbin/cupsd//third_party   /usr/sbin/ippusbxd   /usr/sbin/tcpdump0 profiles are in complain mode.3 processes have profiles defined.3 processes are in enforce mode.   /sbin/dhclient (705)   /usr/sbin/cups-browsed (30173)   /usr/sbin/cupsd (26828)0 processes are in complain mode.0 processes are unconfined but have a profile defined. 
 还应该知道如何启动和停止这些工具。 $ sudo /etc/init.d/apparmor start$ sudo /etc/init.d/apparmor stop$ sudo /etc/init.d/apparmor restart 
 而对于SELinux,各种模式代表什么: enforcing -- SELinux security policy is enforcedpermissive -- SELinux prints warnings instead of enforcingdisabled -- SELinux is fully disabled 
 Linux系统上的许多命令可以帮助管理安全性。上面的描述旨在介绍这些命令,但不解释有关它们如何工作或可以使用的所有内容。 【编辑推荐】 
    【责任编辑:武晓燕 TEL:(010)68476606】如何在Linux中使用Fio来测评硬盘性能Linux命令行厉害,其实Windows的也很强Linux 基金会发布免费电子书 — 《企业开源:实践》如何查看Linux中所有正在运行的服务如何在Windows 10中将安全模式添加到引导菜单选项? 点赞 0
 (编辑:南平站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |