centos 8.2 指南(2)

简介: centos 8.2 指南(2)

使用Moduler存储库

$ dnf module list
Last metadata expiration check: 0:01:21 ago on Tue 01 Nov 2022 10:10:32 PM CST.
CentOS Linux 8 - AppStream
Name                 Stream          Profiles Summary
389-ds               1.4                      389 Directory Server (base)
ant                  1.10 [d]        common [ Java build tool
                                     d]
container-tools      rhel8 [d]       common [ Most recent (rolling) versions of podman, buildah, skopeo, runc, conmon, r
                                     d]       unc, conmon, CRIU, Udica, etc as well as dependencies such as container-se
                                              linux built and tested together, and updated as frequently as every 12 wee
                                              ks.
container-tools      1.0             common [ Stable versions of podman 1.0, buildah 1.5, skopeo 0.1, runc, conmon, CRIU
                                     d]       , Udica, etc as well as dependencies such as container-
subversion           1.14            common [ Apache Subversion
                                     d], serv
                                     er
swig                 3.0 [d]         common [ Connects C/C++/Objective C to some high-level programming languages
                                     d], comp
                                     lete
swig                 4.0             common [ Connects C/C++/Objective C to some high-level programming languages
                                     d], comp
                                     lete
.......................
.......................
varnish              6 [d]           common [ Varnish HTTP cache
                                     d]
virt                 rhel [d]        common [ Virtualization module
                                     d]
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

要安装可用模块,请按如下所示进行配置。

$  dnf module list postgresql
Last metadata expiration check: 0:13:08 ago on Tue 01 Nov 2022 10:10:32 PM CST.
CentOS Linux 8 - AppStream
Name                   Stream             Profiles                       Summary
postgresql             9.6                client, server [d]             PostgreSQL server and client module
postgresql             10 [d]             client, server [d]             PostgreSQL server and client module
postgresql             12                 client, server [d]             PostgreSQL server and client module
postgresql             13                 client, server [d]             PostgreSQL server and client module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
$ dnf module install -y postgresql:10
$  dnf module list postgresql
Last metadata expiration check: 0:15:17 ago on Tue 01 Nov 2022 10:10:32 PM CST.
CentOS Linux 8 - AppStream
Name                  Stream              Profiles                         Summary
postgresql            9.6                 client, server [d]               PostgreSQL server and client module
postgresql            10 [d][e]           client, server [d] [i]           PostgreSQL server and client module
postgresql            12                  client, server [d]               PostgreSQL server and client module
postgresql            13                  client, server [d]               PostgreSQL server and client module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

如果您想更改为已安装模块的另一个版本,请按以下步骤进行配置。

例如,从上面[2]上安装的PostgreSQL 10切换到PostgreSQL 9.6。

$ dnf module reset -y  postgresql  
$ dnf module install  -y postgresql:9.6
#[PostgreSQL 9.6]的状态变为[e]启用
$  dnf module list postgresql
Last metadata expiration check: 0:18:06 ago on Tue 01 Nov 2022 10:10:32 PM CST.
CentOS Linux 8 - AppStream
Name                  Stream             Profiles                          Summary
postgresql            9.6 [e]            client, server [d] [i]            PostgreSQL server and client module
postgresql            10 [d]             client, server [d]                PostgreSQL server and client module
postgresql            12                 client, server [d]                PostgreSQL server and client module
postgresql            13                 client, server [d]                PostgreSQL server and client module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

更新阿里云 yum 源

mv /etc/yum.repos.d /etc/yum.repos.d.bak # 先备份原有的 Yum 源
mkdir /etc/yum.repos.d
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all && yum makecache

用户管理

  1. 要在CentOS服务器上添加普通用户帐户,请按以下步骤设置。
$ useradd centos
$ passwd centos
Changing password for user centos.
New password:                               #输入您要设置的任何密码  
Retype new password:
passwd: all authentication tokens updated successfully.$所有身份验证令牌已成功更新
  1. 如果您想从普通用户切换到root用户帐户,请使用[su]命令。
[root@localhost ~]# su - centos  $切换centos账号
[centos@localhost ~]$ su -       $切换root账号
Password:                       $输入root密码
[root@localhost ~]#              $切换到root账号
  1. 如果您想限制用户运行[su]命令,请进行如下设置。
    在以下示例中,只有[wheel]组中的用户可以运行[su]命令。
[root@localhost ~]# usermod -G wheel centos
[root@localhost ~]# vi /etc/pam.d/su
[root@localhost ~]# cat  /etc/pam.d/su
#%PAM-1.0
auth            required        pam_env.so
auth            sufficient      pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth           sufficient      pam_wheel.so trust use_uid  $我们添加的配置项
# Uncomment the following line to require a user to be in the "wheel" group.
auth            required        pam_wheel.so use_uid
auth            substack        system-auth
auth            include         postlogin
account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         include         postlogin
session         optional        pam_xauth.so
auth          sufficient      pam_rootok.so debug
[root@localhost ~]# groups centos  $查看账号所在的组
centos : centos wheel

我们可以创建一个账号user01没有在wheel组,并尝试切换到root账号

[root@localhost ~]# useradd user01
[root@localhost ~]# passwd user01
Changing password for user user01.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]#
[root@localhost ~]# su - user01
[user01@localhost ~]$
[user01@localhost ~]$ su -
Password:
su: Permission denied  $通常是被拒绝的
[user01@localhost ~]$
  1. 如果您要删除用户帐户,请按以下步骤设置。
[root@localhost ~]# userdel -r user01  #删除用户[user01](仅删除的用户帐户)
userdel: user 'user01' does not exist
[root@localhost ~]# ll /home/
total 4
drwxr-xr-x.  3 admin    admin      78 Sep 28 10:09 admin
drwx------.  4 centos   centos    113 Dec  4 13:56 centos
drwx------. 15 localhost localhost 4096 Sep 27 16:42 localhost
drwx------.  3 tddev    users      78 Sep 28 10:09 tddev
drwx------.  5 tdops    users     143 Oct 15 16:10 tdops
drwx------.  3 tdsec    users      78 Sep 28 10:09 tdsec
drwx------.  4     1006     1006  113 Dec  4 14:16 user01
#删除用户[user01](已删除的用户帐户和他的主目录)
[root@localhost ~]# userdel -r user01
userdel: user 'user01' does not exist
[root@localhost ~]# userdel -r localhost
  1. 添加到wheel组用户免密切换root账号设置步骤。
[root@localhost ~]#  vi /etc/sudoers
## Same thing without a password
%wheel        ALL=(ALL)       NOPASSWD: ALL $添加这段内容后,wheel组用户,切换到root不需要知道root密码。
[root@localhost ~]# su - centos
[centos@localhost ~]$ id
uid=1005(centos) gid=1005(centos) groups=1005(centos),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[centos@localhost ~]$
[centos@localhost ~]$ sudo su - $#免密切换到root账号。
[root@localhost ~]#

给用户添加sudo权限

$ sed -i '/^root.*ALL=(ALL).*ALL/a\going\tALL=(ALL) \tALL' /etc/sudoers
$ cat /etc/sudoers
root    ALL=(ALL)       ALL
going   ALL=(ALL)       ALL

Cockpit 管理控制台

dnf install -y cockpit
systemctl enable --now cockpit.socket
systemctl status --now cockpit.socket

1832b220aa754cd18c504acc7686a560.png

概览

1832b220aa754cd18c504acc7686a560.png

磁盘、cpu、内存、网络监控

1832b220aa754cd18c504acc7686a560.png

安装软件

b41705914ab149ed906428aa9032a946.gif

日志

1832b220aa754cd18c504acc7686a560.png

磁盘存储

1832b220aa754cd18c504acc7686a560.png

网络

1832b220aa754cd18c504acc7686a560.png

用户

1832b220aa754cd18c504acc7686a560.png

服务

1832b220aa754cd18c504acc7686a560.png

应用

1832b220aa754cd18c504acc7686a560.png

诊断报表

1832b220aa754cd18c504acc7686a560.png

kdump

1832b220aa754cd18c504acc7686a560.png

软件更新

1832b220aa754cd18c504acc7686a560.png

界面终端

1832b220aa754cd18c504acc7686a560.png

相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍如何基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
相关文章
|
数据挖掘 数据处理 索引
数据分析必知必会 | TGI指数分析实战
TGI指数,全称Target Group Index,可以反映目标群体在特定研究范围内强势或者弱势。
3730 0
数据分析必知必会 | TGI指数分析实战
|
存储 人工智能 运维
阿里巴巴浙江云计算仁和液冷数据中心获评5A级(设计)绿色数据中心
9月15日,阿里巴巴浙江云计算仁和液冷数据中心在ODCC(开放数据中心委员会,以下同)2020峰会上获得数据中心绿色等级5 A(设计类)认证,成为全国首座绿色等级达5A的液冷数据中心。该数据中心绿色分级评估由ODCC联合中国信通院、TGGC(绿色网格,以下同)发起。阿里巴巴获得此项认证是2020年ODCC颁发的唯一一个5A设计类认证,是ODCC与绿色网格自2013年联合开展数据中心绿色等级评估以来颁发的全国第三个设计类5A等级奖牌,也是阿里巴巴继千岛湖数据中心获评5A绿色数据中心(设计)后又一座获此顶级殊荣的数据中心,再次展现了阿里巴巴数据中心的绿色节能实力。
阿里巴巴浙江云计算仁和液冷数据中心获评5A级(设计)绿色数据中心
|
9月前
|
机器学习/深度学习 编解码 算法
SPMamba-YOLO:多尺度增强+全局建模,水下目标检测精度飙升4.9%!
本文提出SPMamba-YOLO水下目标检测模型:创新融合SPPELAN(增强多尺度特征与感受野)、PSA注意力(抑制背景、提升小目标判别)及Mamba状态空间模块(建模长程依赖),在URPC2022上mAP@0.5达82.5%,超越YOLOv8n 4.9%。
839 2
|
11月前
|
存储 安全 数据安全/隐私保护
档案管理系统:让每一份档案都有迹可循、安全可依
在数字化浪潮席卷各行各业的今天,档案作为承载组织历史记忆、核心信息的重要载体,其管理模式正经历着从传统纸质化到数字化、智能化的深刻变革。过去,纸质档案堆积如山、查找困难、易损坏丢失的问题,让不少组织陷入管理困境;而如今,档案管理系统的出现,彻底打破了这一僵局,实现了“让每一份档案都有迹可循、安全可依”的管理目标。本文将从档案管理的现实痛点出发,深入剖析档案管理系统的核心价值,带大家全面了解这一数字化管理利器。
|
8月前
|
人工智能 弹性计算 Linux
阿里云轻量应用服务器抢购价38元1年、9.9元1个月、199元1年:抢购时间、配置与适用场景解析
2026年阿里云轻量应用服务器抢购活动新增2核4G配置,月付9.9元或年付199元,且预装“OpenClaw”应用镜像,助力用户快速搭建AI助理。活动每天10点和15点开抢,限新用户且每个用户仅享一次。适合个人开发者、学生及小微企业,可用于中小型动态网站、数据库服务器、微服务与容器化应用等。此外,阿里云还提供99元/年经济型e实例和199元/年通用算力型u1实例等备选方案。
|
10月前
|
人工智能 JavaScript 测试技术
Playwright扩展开发:自定义插件与工具创建
本文详解如何为Playwright开发自定义插件与工具:涵盖登录状态管理Fixture、Slack通知Reporter、POM插件及CLI命令行工具,助力解决重复代码、业务封装、第三方集成等实际痛点,提升测试复用性、可维护性与工程效能。
|
10月前
|
弹性计算 人工智能 并行计算
阿里云服务器多少钱一年?2026年新版阿里云服务器配置与价格表解析
在云计算应用日益普及的当下,阿里云服务器凭借稳定的性能、灵活的配置选择和覆盖广泛的地域支持,成为个人开发者、中小企业及大型企业数字化转型的重要基础设施。2026年,阿里云对服务器产品线进行了全面优化,推出了涵盖轻量应用服务器、ECS云服务器、GPU服务器等多个系列的产品,各系列在配置规格、价格定位和适用场景上形成了清晰的区分,满足不同用户的多样化需求。本文基于官方公布的配置参数与价格信息,对2026年阿里云服务器的产品体系、核心配置、价格标准及适用场景进行详细解析,为用户选择合适的服务器提供参考。
804 0
|
11月前
|
算法 安全
智识重塑:智能体领航员驱动的个体进化实录
智能体领航员正引领人类从信息吞噬迈向模型进化。它以苏格拉底式启发促发深度思考,构建心理韧性应对情绪波动,加速技能内化与创意协同,并坚守认知独立性。技术终为镜,照见更真实的自我。
317 1
|
算法 知识图谱
HGAT:假新闻检测的分层图注意力网络
HGAT:假新闻检测的分层图注意力网络
763 0
HGAT:假新闻检测的分层图注意力网络
|
JavaScript 前端开发 中间件
技能学习:学习使用Node.js + Vue.js,开发前端全栈网站-8.server端使用通用CRUD接口
CRUD是指在做计算处理时的增加(Create)、检索(Retrieve)、更新(Update)和删除(Delete)几个单词的首字母简写。CRUD主要被用在描述软件系统中数据库或者持久层的基本操作功能。
695 0
技能学习:学习使用Node.js + Vue.js,开发前端全栈网站-8.server端使用通用CRUD接口

热门文章

最新文章