目录
一、安装wget
yum -y install wget
二、安装vim
1、查看命令
rpm -qa | grep vi
发现Centos里的VI只默认安装了vim-minimal-7.x。所以无论是输入vi或者 vim查看文件,syntax功能都无法正常启用。因此需要用yum安装另外两个组件:vim-common-7.x和vim-enhanced- 7.x
安装命令:
yum -y install vim-enhanced
三、更换yum源为国内的阿里云源(选择)
1、备份CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、生成缓存
yum makecache
四、安装ifconfig
“ifconfig”命令用于配置GNU/Linux系统的网络接口。它显示网络接口卡的详细信息,包括IP地址,MAC地址,以及网络接口卡状态之类。但是,该命令已经过时了,而且在最小化版本的RHEL 7以及它的克隆版本CentOS 7,Oracle Linux 7和Scientific Linux 7中也找不到该命令。
1、在CentOS最小化服务器版本中如何查找网卡IP和其它详细信息?
ip addr
输出样例:
[root@localhost ~]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0c:29:ae:31:1d brd ff:ff:ff:ff:ff:ff inet 192.168.1.105/24 brd 192.168.1.255 scope global noprefixroute dynamic ens33 valid_lft 6238sec preferred_lft 6238sec inet6 fe80::231a:a16b:3c4:b3fc/64 scope link noprefixroute valid_lft forever preferred_lft forever [root@localhost ~]#
2、要查看网络接口统计数据,输入命令
ip link
输出样例:
[root@localhost ~]# ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 00:0c:29:ae:31:1d brd ff:ff:ff:ff:ff:ff [root@localhost ~]#
或
ip -s link
输出样例:
[root@localhost ~]# ip -s link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 RX: bytes packets errors dropped overrun mcast 5568 64 0 0 0 0 TX: bytes packets errors dropped carrier collsns 5568 64 0 0 0 0 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 00:0c:29:ae:31:1d brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped overrun mcast 51012755 37744 0 0 0 0 TX: bytes packets errors dropped carrier collsns 944417 9299 0 0 0 0 [root@localhost ~]#
3、在CentOS 7最小化服务器版本中如何启用并使用“ifconfig”命令?
如果你不知道在哪里可以找到ifconfig命令,请按照以下简单的步骤来找到它。首先,让我们找出哪个包提供了ifconfig命令。要完成这项任务,输入以下命令:
yum search ifconfig
从上边的运行结果中我们可以看出net-tools.x86_64包中提供了ifconfig命令,接下来我们直接安装:
yum -y install net-tools.x86_64
安装完成后的结果:
[root@localhost ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.105 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::231a:a16b:3c4:b3fc prefixlen 64 scopeid 0x20<link> ether 00:0c:29:ae:31:1d txqueuelen 1000 (Ethernet) RX packets 38516 bytes 51393861 (49.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 9636 bytes 1025628 (1001.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 64 bytes 5568 (5.4 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 64 bytes 5568 (5.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [root@localhost ~]#
五、安装zip、unzip
yum install -y unzip zip
六、安装rz和sz命令
yum install -y lrzsz
七、安装Tree命令
yum -y install tree
八、安装telnet
1、先检查系统是否安装了telnet-server和xinetd服务是否安装
rpm -qa telnet-server
2、开始装
yum -y install telnet-server.x86_64
yum -y install telnet.x86_64
yum -y install xinetd.x86_64
3、开始配置并启动Telnet,xinetd和telnet必须设置开机启动,否则无法启动Telnet服务
systemctl enable xinetd.service
systemctl enable telnet.socket
#接下来启动服务
systemctl start telnet.socket
systemctl start xinetd