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

ubuntu-22.04.3 配置

1.防火墙

a、查看防火墙状态:inactive是关闭,active是开启。
sudo ufw statusb、开启防火墙。
sudo ufw enablec、关闭防火墙。
sudo ufw disable

2.设置Ip

ifconfigsudo cp /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml-bak#修改Ip
cat <<EOF | sudo tee /etc/netplan/00-installer-config.yaml
network:ethernets:ens160:addresses:- 192.16.2.11/24routes:- to: defaultvia: 192.16.2.1 ## gatewaynameservers:addresses:- 114.114.114.114- 8.8.8.8version: 2
EOF#更新Ip
sudo netplan apply

3.更新yum网络源

#备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup#阿里源
cat <<EOF | sudo tee /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
EOF#更新软件列表
sudo apt-get update -y# 更新本地软件
sudo apt-get upgrade -y

3.1本地yum源

## 创建挂载目录,挂载镜像源
sudo mkdir /mnt/cdrom
sudo mount /mnt/ubuntu-22.04.3-server-amd64.iso /mnt/cdrom/#备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup#使用本地源jammy 表示版本22
cat <<EOF | sudo tee /etc/apt/sources.list
deb file:///mnt/cdrom jammy main
EOF#清除原有记录
sudo apt-get clean all#更新软件列表
sudo apt-get update -y# 更新本地软件
sudo apt-get upgrade -y

4.安装ssh #启动ssh

sudo apt-get install openssh-server openssh-client net-tools ntpdate -y && sudo /etc/init.d/ssh restart

5.替换上海时区 #时间同步

sudo timedatectl set-timezone Asia/Shanghai  && sudo ntpdate time.windows.com

6.修改root用户密码,命令为:passwd root

#使用root账户,进行ssh登录

sed -i "s|#PermitRootLogin prohibit-password|PermitRootLogin yes|" /etc/ssh/sshd_config 
#重启ssh
sudo systemctl restart ssh

7.修改主机名

sudo hostnamectl set-hostname k8s-mast

8.定时任务同步时间

#查看任务
crontab -l#编辑任务
crontab -e#每小时同步一次时间
0 */1 * * * /usr/sbin/ntpdate 192.16.2.20#保存修改
Ctrl+o#退出
Ctrl+x

9.安装zabbix监控

#安装
apt install zabbix-agent#替换zabbix  配置文件ip192.16.2.25
sed -i "s|Server=127.0.0.1|Server=192.16.2.25|" /etc/zabbix/zabbix_agentd.conf
sed -i "s|ServerActive=127.0.0.1|ServerActive=192.16.2.25|" /etc/zabbix/zabbix_agentd.confsudo vi /etc/zabbix/zabbix_agentd.conf
#被动模式仅需修改Server、Hostname
Hostname=xxx01#启动zabbix
systemctl enable zabbix-agent
systemctl start zabbix-agent.service
systemctl status zabbix-agent.service
http://www.lryc.cn/news/266028.html

相关文章:

  • [工具]java_sublime的快速使用
  • 【银行测试】银行金融测试+金融项目测试点汇总...
  • 将PPT的图保持高分辨率导入到Word / WPS中
  • 如何在Spring Boot中优雅地进行参数校验
  • 图还能有数据库?一文带你了解图数据库是个什么东西!
  • 力扣思维题——寻找重复数
  • 基于Kubernetes的jenkins上线
  • 每日一题——轮转数组
  • Unity手机移动设备重力感应
  • nodejs微信小程序+python+PHP基于推荐算法的电影推荐系统-计算机毕业设计推荐django
  • Linux 配置 swap 区
  • AG16KDDF256 User Manual
  • w15初识php基础
  • powerbuilder Primary! Delete! Filter! 三个缓冲区的作用
  • Confluent 与阿里云将携手拓展亚太市场,提供消息流平台服务
  • 【一起学Rust | 框架篇 | Tauri2.0框架】Tauri2.0环境搭建与项目创建
  • 算法基础之01背包问题
  • Git的总体认知与具体实现
  • Hadoop入门学习笔记——三、使用HDFS文件系统
  • JavaWeb—html, css, javascript, dom,xml, tomcatservlet
  • LangChain 31 模块复用Prompt templates 提示词模板
  • 深入理解 Git 分支管理:提升团队协作与开发效率
  • WPF StackPanel
  • 由正规表达式构造DFA,以及DFA的相关化简
  • 模式识别与机器学习(九):Adaboost
  • 【JAVA】分布式链路追踪技术概论
  • ZooKeeper 使用介绍和原理详解
  • 模式识别与机器学习(八):决策树
  • Pinely Round 3 (Div. 1 + Div. 2)(A~D)(有意思的题)
  • 在Linux下探索MinIO存储服务如何远程上传文件