【linux】新机配置

开启网络

cd /etc/sysconfig/network-scripts/
vi ifcfg-ens33
	...
	BOOTPROTO=dhcp
	...
	ONBOOT=yes
systemctl restart network

关闭防火墙

systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service

安装网络查看工具

yum search ifconfig
yum install net-tools.x86_64

开启ssh

yum install openssh-server
vim /etc/ssh/sshd_config
	...
	Port 22                  #将改行前面的#键去掉,开启22端口
	ListenAddress 0.0.0.0    #将改行前面的#键去掉
	ListenAddress ::         #将改行前面的#键去掉
	...
	PermitRootLogin yes      #将改行前面的#键去掉  允许远程登录
	...
	PasswordAuthentication yes     #将改行前面的#键去掉,这是开启用户名和密码登录
sudo service sshd start
netstat -an | grep 22

安装docker

安装

yum isntall -y docker
systemctl enable docker  # 开机自启动
systemctl start docker  # 启动docker

yum install -y epel-release
yum install -y docker-compose
yum install -y docker-compose

镜像加速

获取阿里镜像加速服务
获取阿里镜像加速服务

vi /etc/docker/daemon.json
	{
	  "registry-mirrors": ["xxx"]
	}
sudo systemctl daemon-reload
sudo systemctl restart docker
posted @ 2023-04-09 17:29  小魁jking  阅读(32)  评论(0编辑  收藏  举报