设置Hostname
修改/etc/hostname
127.0.0.1 localhost.localdomain localhost
10.95.136.51 centos
设置网关
修改/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=centos
GATEWAY=10.95.136.1
设置IP
修改/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0C:29:39:05:BD
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.0.0.0
IPADDR=10.95.136.34
GATEWAY=10.95.136.1
设置DNS
修改/etc/resolv.conf
nameserver 202.103.24.68
重启网络服务
service network restart
禁止root用户远程登录
修改/etc/ssh/sshd_config
将PermitRootLogin 设置为no
PermitRootLogin no
修改/etc/hostname
127.0.0.1 localhost.localdomain localhost
10.95.136.51 centos
设置网关
修改/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=centos
GATEWAY=10.95.136.1
设置IP
修改/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0C:29:39:05:BD
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.0.0.0
IPADDR=10.95.136.34
GATEWAY=10.95.136.1
设置DNS
修改/etc/resolv.conf
nameserver 202.103.24.68
重启网络服务
service network restart
禁止root用户远程登录
修改/etc/ssh/sshd_config
将PermitRootLogin 设置为no
PermitRootLogin no