安装
下载的话就不多说了,常见的系统基本都可以直接使用包管理器直接安装,以Debian 为例
apt update
apt install htop -y
2024/1/21...大约 9 分钟
下载的话就不多说了,常见的系统基本都可以直接使用包管理器直接安装,以Debian 为例
apt update
apt install htop -y
测试系统版本:Debian(11/12)
经过了解学习,Debian 配置策略路由分以下几步,然而第一步也有非常多的知识可以学习和了解,所有的路由和策略的配置都是基于 iproute2 这个包里的命令,部分命令与老命令的对比
| 功能 | ip route | route |
|---|---|---|
| 功能更完整 | √ | × |
| 命令行更简洁 | × | √ |
| 支持更多功能 | √ | × |
| 更适合高级用户 | √ | × |
| 更适合初学者 | × | √ |
/etc/sysctl.conf
net.ipv4.ip_local_port_range = 1024 65535
# 4096 memory size
net.ipv4.tcp_max_syn_backlog = 4096
# 33554432 = 32M 中等流量
net.core.rmem_max = 33554432
net.core.wmem_max = 33554432
用于配置的相关限制
# /etc/security/limits.conf
#
#This file sets the resource limits for the users logged in via PAM.
该文件为通过PAM登录的用户设置资源限制。
#It does not affect resource limits of the system services.
#它不影响系统服务的资源限制。
#Also note that configuration files in /etc/security/limits.d directory,
#which are read in alphabetical order, override the settings in this
#file in case the domain is the same or more specific.
请注意/etc/security/limits.d下按照字母顺序排列的配置文件会覆盖 /etc/security/limits.conf中的
domain相同的的配置
#That means for example that setting a limit for wildcard domain here
#can be overriden with a wildcard setting in a config file in the
#subdirectory, but a user specific setting here can be overriden only
#with a user specific setting in the subdirectory.
这意味着,例如使用通配符的domain会被子目录中相同的通配符配置所覆盖,但是某一用户的特定配置
只能被字母路中用户的配置所覆盖。其实就是某一用户A如果在/etc/security/limits.conf有配置,当
/etc/security/limits.d子目录下配置文件也有用户A的配置时,那么A中某些配置会被覆盖。最终取的值是 /etc/security/limits.d 下的配置文件的配置。
#
#Each line describes a limit for a user in the form:
#每一行描述一个用户配置
#<domain> <type> <item> <value>
#Where:
#<domain> can be:
# - a user name 一个用户名
# - a group name, with @group syntax 用户组格式为@GROUP_NAME
# - the wildcard *, for default entry 默认配置为*,代表所有用户
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
有soft,hard和-,soft指的是当前系统生效的设置值,软限制也可以理解为警告值。
hard表名系统中所能设定的最大值。soft的限制不能比hard限制高,用-表名同时设置了soft和hard的值。
#<item> can be one of the following: <item>可以使以下选项中的一个
# - core - limits the core file size (KB) 限制内核文件的大小。
# - data - max data size (KB) 最大数据大小
# - fsize - maximum filesize (KB) 最大文件大小
# - memlock - max locked-in-memory address space (KB) 最大锁定内存地址空间
# - nofile - max number of open file descriptors 最大打开的文件数(以文件描叙符,file descripter计数)
# - rss - max resident set size (KB) 最大持久设置大小
# - stack - max stack size (KB) 最大栈大小
# - cpu - max CPU time (MIN) 最多CPU占用时间,单位为MIN分钟
# - nproc - max number of processes 进程的最大数目
# - as - address space limit (KB) 地址空间限制
# - maxlogins - max number of logins for this user 此用户允许登录的最大数目
# - maxsyslogins - max number of logins on the system 系统最大同时在线用户数
# - priority - the priority to run user process with 运行用户进程的优先级
# - locks - max number of file locks the user can hold 用户可以持有的文件锁的最大数量
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to values: [-20, 19] max nice优先级允许提升到值
# - rtprio - max realtime pr iority
#
#<domain> <type> <item> <value>
#
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@st
要使用 rpmbuild 制作rpm包,需要安装以下软件
yum install -y rpm-build gcc make rpmlint rpmdevtools
服务器:Centos 7.5
创建一个用户,不指定密码,一切默认,也可以自定义
[root@localhost ~]# useradd user
用户登录权限
userlist_deny 配置项设置为 YES,则在 user_list 文件中列出的用户将被禁止登录到 FTP 服务器yum install vsftpd -y
vim /etc/vsftpd/vsftpd.conf
……
#修改配置文件,添加anon_root=dir ,指向你的yum源包的目录
相对老版本的 find 而言,新版本中 / 类似于 ‘+’ 具有包含的意思(任何一位权限匹配即可), ‘-’ 依然可以使用,指定最小权限(三位匹配)。
数字与符号的写法
-perm /664 == -perm /u+rw,g+rw,o+r (匹配主包含 r或w ,或组包含 r或w ,或其包含 r。5个条件满足一个即可)
-perm -664 == (匹配 主权限包含 rw或rwx,组包含 rw或rwx ,其他包含 r,主组其他是与的关系,必须全部满足。单项为或的关系。)
-perm 664 (只匹配 664 权限,精确匹配)