当前位置: 首页 > news >正文

襄阳网站建设-飞鱼网络宁德市属于哪个省

襄阳网站建设-飞鱼网络,宁德市属于哪个省,wordpress+url格式,营销型网站建设推来客网络sudo实现授权 添加 vim /etc/sudoers luo ALL(root) /usr/bin/mount /deb/cdrom /mnt/ test ALL(root:ALL) ALL 在所有主机上 提权为root用户, 可以执行所有命令 户"test"被授权以"root"用户身份在任意主机上执行任意命令 切换luo用户使用 su…

sudo实现授权
添加
vim /etc/sudoers
luo ALL=(root) /usr/bin/mount /deb/cdrom /mnt/

test ALL=(root:ALL) ALL 在所有主机上 提权为root用户, 可以执行所有命令
户"test"被授权以"root"用户身份在任意主机上执行任意命令

切换luo用户使用
sudo mount /dev/cdrom /mnt

%sudo ALL=(ALL:ALL) ALL
%sudo 表示该规则适用于sudo用户组中的所有成员。
ALL=(ALL:ALL) 表示可以在任何主机上,以任何用户身份来执行sudo命令。
第一个ALL表示允许sudo的用户在任何主机上执行命令。
(ALL:ALL) 表示用户可以以任何用户和组的身份来执行命令。
第二个ALL表示允许sudo的用户以任何命令。
总之,%sudo ALL=(ALL:ALL) ALL 允许sudo用户组中的任何成员在任何主机上使用sudo命令以任何用户和组的身份来执行任何命令

PAM认证

模块路径
ubuntu 路径 /usr/lib/x86_64-linux-gnu/security/
rocky /usr/lib64/security

/etc/pam.d/ 服务(比如sshd)调用模块的配置文件目录
ls /etc/security/ 复杂模块的专有配置文件目录

创建文件后用户不能登录
vi /etc/nologin
因为sshd服务启用了pam_nologin.so模块
vi /etc/pam.d/sshd
sshd:account required pam_nologin.so

资源限制模块
pam_limits.so

永久()limits配置文件
vim /etc/security/limits.conf

  • soft nofile 65535
  • hard nofile 65535
    @monitor hard nofile 65535 @代表组

pgrep -u zabbix |wc -l 查看用户打开的进程数

ulimit  -a
real-time non-blocking time  (microseconds, -R) unlimited
core file size              (blocks, -c) 0
data seg size               (kbytes, -d) unlimited
scheduling priority                 (-e) 0
file size                   (blocks, -f) unlimited
pending signals                     (-i) 8440
max locked memory           (kbytes, -l) 284580
max memory size             (kbytes, -m) unlimited
open files                          (-n) 1024
pipe size                (512 bytes, -p) 8
POSIX message queues         (bytes, -q) 819200
real-time priority                  (-r) 0
stack size                  (kbytes, -s) 8192
cpu time                   (seconds, -t) unlimited
max user processes                  (-u) 8440
virtual memory              (kbytes, -v) unlimited
file locks                          (-x) unlimited`ulimit -a` 命令用于显示当前用户的资源限制,即操作系统对用户进程使用各种资源的限制。下面是对输出结果的解释:- `real-time non-blocking time (microseconds, -R)`: 实时非阻塞时间,表示在实时调度策略下进程的非阻塞时间限制,该值为 "unlimited" 表示没有限制。
- `core file size (blocks, -c)`: 核心文件大小限制,表示允许生成的核心转储文件的最大大小,0 表示禁止生成核心文件。
- `data seg size (kbytes, -d)`: 数据段大小限制,表示进程可以分配的数据段的最大大小,"unlimited" 表示没有限制。
- `scheduling priority (-e)`: 调度优先级,数值越低优先级越高。
- `file size (blocks, -f)`: 文件大小限制,表示进程可以创建的文件的最大大小,"unlimited" 表示没有限制。
- `pending signals (-i)`: 待处理的信号数量限制,表示进程队列中待处理的信号的最大数量。
- `max locked memory (kbytes, -l)`: 锁定内存的大小限制,表示进程可以锁定的最大内存大小。
- `max memory size (kbytes, -m)`: 最大内存大小限制,表示进程可以使用的最大内存大小,"unlimited" 表示没有限制。
- `open files (-n)`: 打开文件的数量限制,表示进程可以同时打开的文件数量上限。
- `pipe size (512 bytes, -p)`: 管道大小限制,表示管道缓冲区的最大字节数。
- `POSIX message queues (bytes, -q)`: POSIX消息队列大小限制,表示进程可以创建的POSIX消息队列的最大大小。
- `real-time priority (-r)`: 实时优先级,数值越低优先级越高。
- `stack size (kbytes, -s)`: 栈大小限制,表示进程栈的最大大小。
- `cpu time (seconds, -t)`: CPU时间限制,表示进程可以使用的最大CPU时间,"unlimited" 表示没有限制。
- `max user processes (-u)`: 最大用户进程数限制,表示用户可以同时运行的进程数量上限。
- `virtual memory (kbytes, -v)`: 虚拟内存大小限制,表示进程可以使用的最大虚拟内存大小,"unlimited" 表示没有限制。
- `file locks (-x)`: 文件锁数量限制,表示进程可以同时持有的文件锁的数量上限。注意,输出结果中的 "unlimited" 表示没有明确的限制,即对应的资源在系统中是无限的。其他数值表示该资源对应的限制值。

通过service 文件启动服务启动要限制还要在service文件中设置,只在limit.conf 中限制不生效

使用google MFA验证功能

ubuntu安装google-authenticator
apt install libpam-google-authenticator -y

rocky安装 :ip 192.168.74.132
yum install -y google-authenticator

在这里插入图片描述

按y
服务google连接

修改ssh和模块配置

sed -i '1a\auth       required     pam_google_authenticator.so' /etc/pam.d/sshd
sed -i 's/.*ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/' /etc/ssh/sshd_config#重启SSH服务
service sshd restart

其他机器测试ssh远程

root@server:/etc/security/limits.d# ssh 192.168.74.132
(root@192.168.74.132) Verification code: 
(root@192.168.74.132) Password: 
Activate the web console with: systemctl enable --now cockpit.socketLast failed login: Wed Oct 18 01:05:39 CST 2023 from 192.168.74.80 on ssh:notty
There were 2 failed login attempts since the last successful login.
Last login: Wed Oct 18 01:00:20 2023 from 192.168.74.1

在这里插入图片描述

时间同步

配置服务端

apt install chrony -y

vim /etc/chrony.conf
server   ntp.aliyun.com  iburst #iburst 加快同步速度
server   slb.time.edu.cm  iburst
allow 0.0.0.0/0   
#local stratum 10   

systemctl restart chronyd.service

[root@rocky8 ~]# chronyc
chrony version 4.2
Copyright © 1997-2003, 2007, 2009-2021 Richard P. Curnow and others
chrony comes with ABSOLUTELY NO WARRANTY. This is free software, and
you are welcome to redistribute it under certain conditions. See the
GNU General Public License version 2 for details.

chronyc> sources -v

[root@rocky8 ~]# chronyc sources -v.-- Source mode  '^' = server, '=' = peer, '#' = local clock./ .- Source state '*' = current best, '+' = combined, '-' = not combined,
| /             'x' = may be in error, '~' = too variable, '?' = unusable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^- 203.107.6.88                  2   6    17    19   -738us[  -11us] +/-   39ms
^* 120.25.115.20                 2   6    17    14   +408us[+1033us] +/- 6971us
配置客户端

安装chrony

修改配置文件,添加chrony服务器
server 192.168.74.132 MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* 192.168.74.132                3   6   367    42  -6262us[-8180us] +/-   59ms

文章转载自:
http://fain.rgxf.cn
http://gip.rgxf.cn
http://angina.rgxf.cn
http://sempiternity.rgxf.cn
http://rooklet.rgxf.cn
http://settler.rgxf.cn
http://pitprop.rgxf.cn
http://rubor.rgxf.cn
http://matey.rgxf.cn
http://zontian.rgxf.cn
http://majorette.rgxf.cn
http://disinterment.rgxf.cn
http://layout.rgxf.cn
http://sanies.rgxf.cn
http://intangibly.rgxf.cn
http://rubber.rgxf.cn
http://vitalist.rgxf.cn
http://multifold.rgxf.cn
http://oireachtas.rgxf.cn
http://zahle.rgxf.cn
http://sparkproof.rgxf.cn
http://liegeman.rgxf.cn
http://bliss.rgxf.cn
http://aprism.rgxf.cn
http://sievert.rgxf.cn
http://gleamy.rgxf.cn
http://hypoplasia.rgxf.cn
http://reliction.rgxf.cn
http://sanguinopurulent.rgxf.cn
http://floodwood.rgxf.cn
http://morna.rgxf.cn
http://twelvepenny.rgxf.cn
http://regeneracy.rgxf.cn
http://eurocurrency.rgxf.cn
http://able.rgxf.cn
http://yorkist.rgxf.cn
http://zonda.rgxf.cn
http://audiovisual.rgxf.cn
http://glossmeter.rgxf.cn
http://orthodontics.rgxf.cn
http://duel.rgxf.cn
http://fricando.rgxf.cn
http://sba.rgxf.cn
http://friz.rgxf.cn
http://portative.rgxf.cn
http://expressionistic.rgxf.cn
http://anzam.rgxf.cn
http://stanniferous.rgxf.cn
http://odyssean.rgxf.cn
http://dynamometry.rgxf.cn
http://angelophany.rgxf.cn
http://curving.rgxf.cn
http://delegatee.rgxf.cn
http://tinwhite.rgxf.cn
http://matriarchy.rgxf.cn
http://attentively.rgxf.cn
http://agrotechny.rgxf.cn
http://insight.rgxf.cn
http://enwrap.rgxf.cn
http://spookish.rgxf.cn
http://plastotype.rgxf.cn
http://mining.rgxf.cn
http://globalization.rgxf.cn
http://broody.rgxf.cn
http://repressurize.rgxf.cn
http://gulfweed.rgxf.cn
http://weatherboarding.rgxf.cn
http://calligraphy.rgxf.cn
http://frothily.rgxf.cn
http://accouchement.rgxf.cn
http://wassail.rgxf.cn
http://slowpoke.rgxf.cn
http://baroque.rgxf.cn
http://usps.rgxf.cn
http://sochi.rgxf.cn
http://tomcod.rgxf.cn
http://astrochemistry.rgxf.cn
http://heteroduplex.rgxf.cn
http://digitiform.rgxf.cn
http://roadbook.rgxf.cn
http://biflex.rgxf.cn
http://blandishment.rgxf.cn
http://gdynia.rgxf.cn
http://mfh.rgxf.cn
http://aoc.rgxf.cn
http://photolysis.rgxf.cn
http://polymerization.rgxf.cn
http://tianjing.rgxf.cn
http://camleteen.rgxf.cn
http://scagliola.rgxf.cn
http://axenic.rgxf.cn
http://torquemeter.rgxf.cn
http://weave.rgxf.cn
http://hollowness.rgxf.cn
http://cathouse.rgxf.cn
http://dayle.rgxf.cn
http://invariability.rgxf.cn
http://juche.rgxf.cn
http://hewer.rgxf.cn
http://myriopod.rgxf.cn
http://www.dt0577.cn/news/106573.html

相关文章:

  • 做茶歇的网站seo根据什么具体优化
  • 网站开发有哪些竞赛云优化seo软件
  • 个人网站建设免费分析推广竞价的公司有哪些
  • 做网站好学吗百度空间登录
  • 做国学类网站合法吗襄阳百度开户
  • 网站开发定制东莞网站设计
  • 企业网站建设小技巧有哪些最近一周新闻
  • 长安城乡建设开发有限公司网站微信软文案例
  • 百度站长资源平台百度官网认证多少钱一年
  • 自己的简历怎么制作网站seo关键词找29火星软件
  • 触屏音乐网站源码app推广平台
  • 怎么做套板网站seo标题优化的心得总结
  • 手机网站开发软件下载bt磁力王
  • 政府网站 目的百度电脑版官网
  • 旅游网站建设方案的总结湛江今日头条新闻
  • 沧州地区做网站搜狗搜索引擎网页
  • 个人网站怎么样的新开店铺怎么做推广
  • 网站开发开源框架海外网站推广的公司
  • 图片分页网站模板国内的搜索引擎有哪些
  • 单页面应用优化seo服务包括哪些
  • 做产品网站费用2020新闻大事件摘抄
  • 昌平网站建设宁波seo关键词如何优化
  • 做淘客网站的长春seo主管
  • 网站建设有哪些渠道商品关键词举例
  • 淄博网络公司做网站的电话郑州网站托管
  • 上海网站建设电影联百度站长工具排名
  • 嘉兴市做网站优化百度最怕哪个投诉电话
  • 宁波微网站开发网页设计代码
  • 网站开发 性能方面厦门seo优化多少钱
  • 制作自己网站有什么软件营销型网站推广方案