centos7基础环境配置

  1. 先安装补充软件包
    yum -y install wget vim lrzsz bash-completion telnet nmap
    注意:
    安装完成后,请重新登录一下,否则自动补全命令无法生效
  2. 关闭selinux:
    /etc/selinux/config
  3. 关闭防火墙
  • systemctl stop firewalld.service
    Active: inactive (dead) since Thu 2019-10-17 23:59:4 显示关闭
    [[email protected] ~]# systemctl disable firewalld.service 关闭防火墙开机自动启
    Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
  1. 防火墙开机自启动关闭
  • [[email protected] ~]# systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
    Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
    Active: inactive (dead) 当前是否在启动
    Docs: man:firewalld(1)

Oct 17 23:08:45 oldboy-c systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 17 23:08:48 oldboy-c systemd[1]: Started firewalld - dynamic firewall daemon.
网络相关命令

  1. 显示网卡
    [[email protected] ~]# ip a show eth0
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:52:6a:2e brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.201/24 brd 10.0.0.255 scope global noprefixroute eth0
    valid_lft forever preferred_lft forever
    inet6 fe80::f4f5:94d1:6970:8364/64 scope link noprefixroute
    valid_lft forever preferred_lft forever
  2. ss -lntup 查看端口开启
  3. ss -ant
    修改hostname
    /etc/hostname 配置文件
    hostname set-hostname oldboy 临时加永久修改主机名
    修改字符集
    localectl set-locale LANG=zh_CN.UTF-8
    查看版本
    [[email protected] ~]# cat /etc/os-release
    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

修改自启动的文件,需要加执行权限
分享图片
查看和修改运行级别
分享图片

相关文章
相关标签/搜索