补充安装软件包

CentOS7.4刚安装,很多基础命令都没有,因此我们需要手动安装一些常用命令。(安装完场后,重新连接ssh)

[root@Su ~]# yum -y install wget vim lrzsz bash-completion telnet nmap

如果最小化安装的CentOS7中yum命令没有的话,就不能用上述方式进行安装。这时我们可以将光盘(CentOS-7-x86_64-DVD-1708.iso)挂载到系统上,然后进入Packages中,用rpm -ivh xxx.rpm安装。

[root@Su mnt]# mount /dev/cdrom /mnt/                 //挂载
mount: /dev/sr0 is write-protected, mounting read-only
[root@Su mnt]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        48G  1.5G   47G   4% /
devtmpfs        2.0G     0  2.0G   0% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           2.0G  8.6M  2.0G   1% /run
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda1      1014M  120M  895M  12% /boot
tmpfs           394M     0  394M   0% /run/user/0
/dev/sr0        4.3G  4.3G     0 100% /mnt
[root@Su mnt]# cd /mnt/                             //查看挂载
CentOS_BuildTag               GPL                           Packages/                     TRANS.TBL
.discinfo                     images/                       repodata/                     .treeinfo
EFI/                          isolinux/                     RPM-GPG-KEY-CentOS-7          
EULA                          LiveOS/                       RPM-GPG-KEY-CentOS-Testing-7  
[root@Su mnt]# cd /mnt/Packages/                    //进入Packages
[root@Su Packages]# rpm -ivh nmap-
nmap-6.40-7.el7.x86_64.rpm       nmap-ncat-6.40-7.el7.x86_64.rpm  
[root@Su Packages]# rpm -ivh nmap-6.40-7.el7.x86_64.rpm 

 

关闭selinux

[root@Su /]# 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.
##此处disabled为永久关闭selinux,需要重启生效
SELINUX=disabled    
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

#临时关闭selinux :setenforce 0
#查看selinux状态:getenforce

 

关闭防火墙

[root@Su /]# systemctl stop firewalld       ##关闭防火墙
[root@Su /]# systemctl disable firewalld     ##禁止开机启动
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@Su /]# 

#systemctl enable firewalld     ##开机启动
 

以上操作完成后,可以做一个快照,保留初始系统的节点,以防下次需要恢复。

最后修改于 2019-12-24 16:34:56
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付
上一篇