linux该如何学习

linux该如何学习,第1张

学习Linux时,可以按照以下路线进行学习:

第一阶段:linux基础入门

1. 开班课程介绍-规章制度介绍-破冰活动

2. Linux硬件基础/Linux发展历史

3. Linux系统安装/xshell连接/xshell优化/SSH远程连接故障问题排查

4. 第一关一大波命令及特殊字符知识考试题讲解

5. Linux基础优化

6. Linux目录结构知识精讲

7. 第二关一大波命令及特殊知识考试题讲解(上)

8. 第二关一大波命令及特殊知识考试题讲解(下)

9. Linux文件属性一大堆知识精讲

10. Linux通配符/正则表达式

11. 第三关一大波命令及重要知识考试题讲解(上)

12. 第三关一大波命令及重要知识考试题讲解(下)

13. Linux系统权限(上)

14. Linux系统权限(下)

15. 整体课程回顾

第二阶段:linux系统管理进阶

1. Linux定时任务

2. Linux用户管理

3. Linux磁盘与文件系统(上)

4. Linux磁盘与文件系统(下)

5. Linux三剑客之sed命令

第三阶段:Linux Shell基础

1. Shell编程基础上

2. Shell编程基础下

3. Linux三剑客之awk命令

第四阶段:Linux网络基础

1. 计算机网络基础上

2. 计算机网络基础下

3. 第二阶段整体课程回顾

第五阶段:Linux网络服务

1. 集群实战架构开始及环境准备

2. rsync数据同步服务

3. Linux全网备份项目案例精讲

4. nfs网络存储服务精讲

5. inotify/sersync实时数据同步/nfs存储实时备份项目案例精讲

第六阶段:Linux重要网络服务

1. http协议/www服务基础

2. nginx web介绍及基础实践

3. nginx web精讲结束

4. lnmp环境部署/数据库异机迁移/共享数据异机迁移到NFS系统

5. nginx负载均衡

6. keepalived高可用

第七阶段:Linux中小规模集群构建与优化(50台)

1. 期中架构开战说明+期中架构部署回顾

2. 部署期中架构并完成上台述职演讲

3. kickstart cobbler批量自动安装系统

4. pptp vpn与ntp服务

5. memcached原理及部署/作为缓存及session会话共享

第八阶段:Ansible自动化运维与Zabbix监控

1. SSH服务秘钥认证

2. ansible批量自动化管理集群

3. zabbix监控

第九阶段:大规模集群高可用服务(Lvs、Keepalived)

1. Centos7系统自行安装/centos6与7区别

2. lvs负载均衡集群/keepalived管理LVS集群

第十阶段:Java Tomcat服务及防火墙Iptables

1. iptables防火墙精讲上

2. iptables防火墙精讲下

3. tomcat java应用服务/nginx配合tomcat服务部署及优化

第十一阶段:MySQL DBA高级应用实践

1. MySQL数据库入门基础命令

2. MySQL数据库进阶备份恢复

3. MySQL数据库深入事务引擎

4. MySQL数据库优化SQL语句优化

5. MySQL数据库集群主从复制/读写分离

6. MySQL数据库高可用/mha/keepalved

第十二阶段:高性能数据库Redis和Memcached课程

第十三阶段:Linux大规模集群架构构建(200台)

第十四阶段:Linux Shell编程企业案例实战

第十五阶段:企业级代码发布上线方案(SVN和Git)

1. GIT管理

2. 代码上线项目案例

第十六阶段:企业级Kvm虚拟化与OpenStack云计算

1. KVM虚拟化企业级实战

2. OpenStack云计算企业级实战

第十七阶段:公有云阿里云8大组件构建集群实战

第十八阶段:Docker技术企业应用实践

1. Docker容器与微服务深入实践

2. 大数据Hadoop生态体系及实践

第十九阶段:Python自动化入门及进阶

第二十阶段:职业规划与高薪就业指导

为了执行权限检查,传统的 UNIX 实现区分两种类型的进程:特权进程(其有效用户 ID 为0,称为超级用户或 root),和非特权用户(其有效 UID 非0)。特权进程绕过所有的内核权限检查,而非特权进程受基于进程的认证信息(通常是:有效 UID,有效 GID,和补充组列表)的完整权限检查的支配。

自内核 2.2 版本开始,Linux 将传统上与超级用户关联的特权分为几个单元,称为 capabilities (权能),它们可以被独立的启用或禁用。权能是每个线程的属性。

下面的列表展示了 Linux 上实现的权能,以及每种权能允许的 *** 作或行为:

权能的完整实现需要:

在内核 2.6.24 之前,只有前两个要求能够满足;自内核 2.6.24 开始,所有三个要求都能满足。

每个线程具有三个包含零个或多个上面的权能的权能集合:

A child created via fork(2) inherits copies of its parent's capability sets. See below for a discussion of the treatment of capabilities during execve(2).

Using capset(2), a thread may manipulate its own capability sets (see below).

Since Linux 3.2, the file /proc/sys/kernel/cap_last_cap exposes the numerical value of the highest capability supported by the running kernelthis can be used to determine the highest bit that may be set in a capability set.

Since kernel 2.6.24, the kernel supports associating capability sets with an executable file using setcap(8). The file capability sets are stored in an extended attribute (see setxattr(2)) named security.capability. Writing to this extended attribute requires the CAP_SETFCAP capability. The file capability sets, in conjunction with the capability sets of the thread, determine the capabilities of a thread after an execve(2).

The three file capability sets are:

During an execve(2), the kernel calculates the new capabilities of the process using the following algorithm:

其中:

A privileged file is one that has capabilities or has the set-user-ID or set-group-ID bit set.

In order to provide an all-powerful root using capability sets, during an execve(2):

The upshot of the above rules, combined with the capabilities transformations described above, is that when a process execve(2)s a set-user-ID-root program, or when a process with an effective UID of 0 execve(2)s a program, it gains all capabilities in its permitted and effective capability sets, except those masked out by the capability bounding set. This provides semantics that are the same as those provided by traditional UNIX systems.

The capability bounding set is a security mechanism that can be used to limit the capabilities that can be gained during an execve(2). The bounding set is used in the following ways:

Note that the bounding set masks the file permitted capabilities, but not the inherited capabilities. If a thread maintains a capability in its inherited set that is not in its bounding set, then it can still gain that capability in its permitted set by executing a file that has the capability in its inherited set.

Depending on the kernel version, the capability bounding set is either a system-wide attribute, or a per-process attribute.

In kernels before 2.6.25, the capability bounding set is a system-wide attribute that affects all threads on the system. The bounding set is accessible via the file /proc/sys/kernel/cap-bound. (Confusingly, this bit mask parameter is expressed as a signed decimal number in /proc/sys/kernel/capbound.)

Only the init process may set capabilities in the capability bounding setother than that, the superuser (more precisely: programs with the CAP_SYS_MODULE capability) may only clear capabilities from this set.

On a standard system the capability bounding set always masks out the CAP_SETPCAP capability. To remove this restriction (dangerous!), modify the definition of CAP_INIT_EFF_SET in include/linux/capability.h and rebuild the kernel.

The system-wide capability bounding set feature was added to Linux starting with kernel version 2.2.11.

From Linux 2.6.25, the capability bounding set is a per-thread attribute. (There is no longer a systemwide capability bounding set.)

The bounding set is inherited at fork(2) from the thread's parent, and is preserved across an execve(2).

A thread may remove capabilities from its capability bounding set using the prctl(2) PR_CAPBSET_DROP operation, provided it has the CAP_SETPCAP capability. Once a capability has been dropped from the bounding set, it cannot be restored to that set. A thread can determine if a capability is in its bounding set using the prctl(2) PR_CAPBSET_READ operation.

Removing capabilities from the bounding set is supported only if file capabilities are compiled into the kernel. In kernels before Linux 2.6.33, file capabilities were an optional feature configurable via the CONFIG_SECURITY_FILE_CAPABILITIES option. Since Linux 2.6.33, the configuration option has been removed and file capabilities are always part of the kernel. When file capabilities are compiled into the kernel, the init process (the ancestor of all processes) begins with a full bounding set. If file capabilities are not compiled into the kernel, then init begins with a full bounding set minus CAP_SETPCAP, because this capability has a different meaning when there are no file capabilities.

Removing a capability from the bounding set does not remove it from the thread's inherited set. However it does prevent the capability from being added back into the thread's inherited set in the future.

To preserve the traditional semantics for transitions between 0 and nonzero user IDs, the kernel makes the following changes to a thread's capability sets on changes to the thread's real, effective, saved set, and filesystem user IDs (using setuid(2), setresuid(2), or similar):

If a thread that has a 0 value for one or more of its user IDs wants to prevent its permitted capability set being cleared when it resets all of its user IDs to nonzero values, it can do so using the prctl(2) PR_SET_KEEPCAPS operation or the SECBIT_KEEP_CAPS securebits flag described below.

A thread can retrieve and change its capability sets using the capget(2) and capset(2) system calls. However, the use of cap_get_proc(3) and cap_set_proc(3), both provided in the libcap package, is preferred for this purpose. The following rules govern changes to the thread capability sets:

Starting with kernel 2.6.26, and with a kernel in which file capabilities are enabled, Linux implements a set of per-thread securebits flags that can be used to disable special handling of capabilities for UID 0 (root). These flags are as follows:

Each of the above "base" flags has a companion "locked" flag. Setting any of the "locked" flags is irreversible, and has the effect of preventing further changes to the corresponding "base" flag. The locked flags are: SECBIT_KEEP_CAPS_LOCKED, SECBIT_NO_SETUID_FIXUP_LOCKED, SECBIT_NOROOT_LOCKED, and SECBIT_NO_CAP_AMBIENT_RAISE.

The securebits flags can be modified and retrieved using the prctl(2) PR_SET_SECUREBITS and PR_GET_SECUREBITS operations. The CAP_SETPCAP capability is required to modify the flags.

The securebits flags are inherited by child processes. During an execve(2), all of the flags are preserved, except SECBIT_KEEP_CAPS which is always cleared.

An application can use the following call to lock itself, and all of its descendants, into an environment where the only way of gaining capabilities is by executing a program with associated file capabilities:

For a discussion of the interaction of capabilities and user namespaces, see user_namespaces(7).

No standards govern capabilities, but the Linux capability implementation is based on the withdrawn POSIX.1e draft standardsee ⟨ http://wt.tuxomania.net/publications/posix.1e/ ⟩.

From kernel 2.5.27 to kernel 2.6.26, capabilities were an optional kernel component, and can be enabled/disabled via the CONFIG_SECURITY_CAPABILITIES kernel configuration option.

The /proc/PID/task/TID/status file can be used to view the capability sets of a thread. The /proc/PID/status file shows the capability sets of a process's main thread. Before Linux 3.8, nonexistent capabilities were shown as being enabled (1) in these sets. Since Linux 3.8, all nonexistent capabilities (above CAP_LAST_CAP) are shown as disabled (0).

The libcap package provides a suite of routines for setting and getting capabilities that is more comfortable and less likely to change than the interface provided by capset(2) and capget(2). This package also provides the setcap(8) and getcap(8) programs. It can be found at ⟨ http://www.kernel.org/pub/linux/libs/security/linux-privs ⟩.

Before kernel 2.6.24, and from kernel 2.6.24 to kernel 2.6.32 if file capabilities are not enabled, a thread with the CAP_SETPCAP capability can manipulate the capabilities of threads other than itself. However, this is only theoretically possible, since no thread ever has CAP_SETPCAP in either of these cases:

capsh(1), setpriv(1), prctl(2), setfsuid(2), cap_clear(3), cap_copy_ext(3), cap_from_text(3), cap_get_file(3), cap_get_proc(3), cap_init(3), capgetp(3), capsetp(3), libcap(3), credentials(7), user_namespaces(7), pthreads(7), getcap(8), setcap(8)

include/linux/capability.h in the Linux kernel source tree

This page is part of release 4.04 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at http://www.kernel.org/doc/man-pages/ .

学习Linux步骤:

1、先了解了解基础吧,找一本薄一点的,浅一点的书,了解一下什么是linux。有个基本了解即可。不建议马上看《鸟哥的Linux私房菜》,这本书很不错,如果你了解linux基础之后再看,对你可以说是不受益匪浅都不行。没基础看《鸟哥的Linux私房菜》比较痛苦,内容很多。

2、了解之后,在自己电脑上弄个虚拟机,装上linux系统(redhat或ubuntu都行)。专攻《鸟哥的Linux私房菜》。当你把这本书攻下来时,才知道原来命令行并不可怕,自己打着打着就很长啦。

学linux最主要靠实践,不实践,只看书对你没好处的哦。自己在虚拟机上慢慢玩吧,玩多了就知道咋回事啦。不懂的多找资料弄懂,弄懂之后再实践,这才会有收获。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8457542.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-16
下一篇 2023-04-16

发表评论

登录后才能评论

评论列表(0条)

保存