加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (https://www.0577zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

22个必须学习的Linux安全命令

发布时间:2018-08-16 21:11:03 所属栏目:Windows 来源:君子兰 翻译
导读:副标题#e# 技术沙龙 | 邀您于8月25日与国美/AWS/转转三位专家共同探讨小程序电商实战 Linux系统的安全性涉及很多方面,从设置帐户到确保用户合法,限制比完成工作所需的更多权限。这里是关于Linux系统日常工作的一些最基本的安全命令。 sudo 使用sudo运行特

查看手册页(man passwd)了解详细信息并使用以下命令:

  1. $ 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文件进行完整性检查,确保存在必需的字段,存在文件和目录等。

  1. $ 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设置说明文件,但仅此而已。 使用这样的命令修改文件的访问控制列表:

  1. $ setfacl -m u:nemo:r ufw-setup 

然后getfacl命令将显示已进行的更改:

  1. $ 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

  1. https://www.networkworld.com/article/3272286/open-source-tools/22-essential-security-commands-for-linux.html 

apparmor

  1. $ 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. 

还应该知道如何启动和停止这些工具。

  1. $ sudo /etc/init.d/apparmor start$ sudo /etc/init.d/apparmor stop$ sudo /etc/init.d/apparmor restart 

而对于SELinux,各种模式代表什么:

  1. enforcing -- SELinux security policy is enforcedpermissive -- SELinux prints warnings instead of enforcingdisabled -- SELinux is fully disabled 

Linux系统上的许多命令可以帮助管理安全性。上面的描述旨在介绍这些命令,但不解释有关它们如何工作或可以使用的所有内容。

【编辑推荐】

  1. 如何在Linux中使用Fio来测评硬盘性能
  2. Linux命令行厉害,其实Windows的也很强
  3. Linux 基金会发布免费电子书 — 《企业开源:实践》
  4. 如何查看Linux中所有正在运行的服务
  5. 如何在Windows 10中将安全模式添加到引导菜单选项?
【责任编辑:武晓燕 TEL:(010)68476606】
点赞 0

(编辑:温州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读