vmware新装虚拟机基础配置

最小化完成虚拟机安装过程

登陆服务器之后需要需要做的一些基础配置如下:

一:配置yum源-采用本地yum源方式

# 使用命令ip a 查看Ip地址,使用远程连接工具连接到虚拟机
# 如果没有Ip 使用dhclinet 命令获取Ip地址
[root@localhost ~]# ip a | grep inet

# rhel7的yum源配置方式:

# rhel8的yum源配置方式:
# 使用mount命令挂载磁盘,如果挂载提示如下,则检查虚拟机的光盘挂载情况
mount: /mnt: no medium found on /dev/sr0.

[root@localhost ~]# mount /dev/cdrom /mnt                                   # 将磁盘挂载到/mnt目录中
mount: /mnt: WARNING: device write-protected, mounted read-only.            # 提示这个则挂载成功
# 编写yum源的配置文件
cat <<EOF>>  /etc/yum.repos.d/rhel8-2.repo
[BaseOS]
baseurl=file:///mnt/BaseOS/
enable=1
gpgcheck=0

[AppStream]
baseurl=file:////mnt/AppStream/
enable=1
gpgcheck=0
EOF

[root@localhost yum.repos.d]# yum repolist                                          # 查看yum源是否配置成功
Failed to set locale, defaulting to C.UTF-8
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'BaseOS' is missing name in configuration, using id.
Repository 'AppStream' is missing name in configuration, using id.
repo id                                                                         repo name
AppStream                                                                       AppStream
BaseOS                                                                          BaseOS

二:安装基础软件包

[root@localhost ~]# yum -y install bash-completion                                # 安装bash-completion工具,可以使用tab键补全命令
[root@localhost ~]# yum -y install vim                                            # 习惯使用vim的命令,所以安装vim包
[root@localhost ~]# yum -y install net-tools                                       # 安装net-tools工具,支持netstat命令
[root@localhost ~]# rpm -ql net-tools | grep sbin                                  # 查看安装net-tools所产生的命令
/usr/sbin/arp
/usr/sbin/ether-wake
/usr/sbin/ifconfig
/usr/sbin/ipmaddr
/usr/sbin/iptunnel
/usr/sbin/mii-diag
/usr/sbin/mii-tool
/usr/sbin/nameif
/usr/sbin/plipconfig
/usr/sbin/route
/usr/sbin/slattach

三:调整防火墙策略

此配置用于学习实验环境配置,将防火墙以及selinux进行关闭

[root@localhost ~]# systemctl disable firewalld.service
[root@localhost ~]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive            #此参数关闭
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

自此基本的使用配置已经完成,有操作习惯的包也安装上

posted @ 2020-10-29 13:56  格桑梅朵儿  阅读(1375)  评论(0编辑  收藏  举报