黑猴子的家:华为 OpenEuler(欧拉) Linux 之基本

2022-03-09  本文已影响0人  黑猴子的家

1、修改root的密码

[root@localhost ~]# echo 000000 | passwd --stdin root
Changing password for user root.
passwd: all authentication tokens updated successfully.

2、修改普通用户alex的密码

[root@localhost ~]# echo 000000 | passwd --stdin alex
Changing password for user alex.
passwd: all authentication tokens updated successfully.

3、配置远程Yum源

1)查看系统内核

[root@localhost ~]# uname -a
Linux openeuler100 4.19.90-2003.4.0.0036.oe1.x86_64 #1 SMP Mon Mar 23 19:10:41 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

2)编辑openEuler_x86_64.repo文件
x86_64架构

[root@localhost ~]# vim /etc/yum.repos.d/openEuler_x86_64.repo
[Base-OpenEuler-20.03-LTS-x86_64]
name=Base-OpenEuler-20.03-LTS-x86_64
baseurl=https://repo.openeuler.org/openEuler-20.03-LTS/OS/x86_64/
enabled=1
gpgcheck=0

[OS]
name=OS
baseurl=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler
 
[everything]
name=everything
baseurl=http://repo.openeuler.org/openEuler-21.03/everything/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/everything/$basearch/RPM-GPG-KEY-openEuler
 
[EPOL]
name=EPOL
baseurl=http://repo.openeuler.org/openEuler-21.03/EPOL/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler
 
[debuginfo]
name=debuginfo
baseurl=http://repo.openeuler.org/openEuler-21.03/debuginfo/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/debuginfo/$basearch/RPM-GPG-KEY-openEuler
 
[source]
name=source
baseurl=http://repo.openeuler.org/openEuler-21.03/source/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/source/RPM-GPG-KEY-openEuler
 
[update]
name=update
baseurl=http://repo.openeuler.org/openEuler-21.03/update/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler

aarch64架构

[root@localhost ~]# vim /etc/yum.repos.d/openEuler_x86_64.repo
[Base-OpenEuler-20.03-LTS-aarch64]
name=Base-OpenEuler-20.03-LTS-aarch64
baseurl=https://repo.openeuler.org/openEuler-20.03-LTS/OS/aarch64/
enabled=1
gpgcheck=0

[OS]
name=OS
baseurl=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler
 
[everything]
name=everything
baseurl=http://repo.openeuler.org/openEuler-21.03/everything/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/everything/$basearch/RPM-GPG-KEY-openEuler
 
[EPOL]
name=EPOL
baseurl=http://repo.openeuler.org/openEuler-21.03/EPOL/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler
 
[debuginfo]
name=debuginfo
baseurl=http://repo.openeuler.org/openEuler-21.03/debuginfo/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/debuginfo/$basearch/RPM-GPG-KEY-openEuler
 
[source]
name=source
baseurl=http://repo.openeuler.org/openEuler-21.03/source/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/source/RPM-GPG-KEY-openEuler
 
[update]
name=update
baseurl=http://repo.openeuler.org/openEuler-21.03/update/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler

3)yum make cache 一下

[root@localhost ~]# yum makecache

4、配置本地yum源

1)创建/mnt/cdrom目录

[root@localhost ~]# mkdir -p /mnt/cdrom

2)挂载ISO镜像

[root@localhost ~]# mount -t iso9660 /dev/cdrom /mnt/cdrom/

3)安装httpd和 vim服务

[root@localhost ~]# yum install -y httpd vim firefox net-tools

4)创建openeuler 目录

[root@localhost ~]# mkdir -p /var/www/html/openeuler

5)复制rpm包

[root@localhost ~]# cp -r /mnt/cdrom/Packages/ /var/www/html/openeuler/
[root@localhost ~]# cp -r /mnt/cdrom/repodata/ /var/www/html/openeuler/

6)编辑openEuler_x86_64_local.repo文件

[root@localhost ~]# vim /etc/yum.repos.d/openEuler_x86_64_local.repo
[Base-OpenEuler-20.03-LTS-aarch64-local]
name=Base-OpenEuler-20.03-LTS-aarch64-local
baseurl=file:///var/www/html/openeuler
enabled=1
gpgcheck=0

7)yum make cache一下

[root@localhost ~]# yum makecache

5、修改主机名称

[root@localhost ~]# hostnamectl set-hostname openeuler100
[root@localhost ~]# hostname
openeuler100

6、修改网络

1)修改静态IP

[root@openeuler100 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens33
#UUID=9782ee03-7a90-45bd-93d0-11c8a65206e2
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.2.100
GATEWAY=192.168.2.2
NETMASK=255.255.255.0
DNS1=192.168.2.2
DNS2=114.114.114.114

2)拔下ens33网卡

[root@openeuler100 ~]# ifdown ens33

3)插上ens33网卡

[root@openeuler100 ~]# ifup ens33

7、配置映射

[root@openeuler100 ~]# vim /etc/hosts
192.168.2.100 openeuler100

8、关闭防火墙

1)关闭防火墙

[root@openeuler100 ~]# systemctl stop firewalld.service

2)开机禁止启动防火墙

[root@openeuler100 ~]# systemctl disable firewalld.service

3)查看防火墙状态

[root@openeuler100 ~]# systemctl status firewalld.service
上一篇下一篇

猜你喜欢

热点阅读