(1)关闭防火墙
centos6:
查看状态:service iptables status
临时关闭:service iptables stop
禁止开机启动:chkconfig iptables off
centos7:
查看默认防火墙状态:firewall-cmd --state
检查防火墙的状态(从centos7开始使用systemctl来管理服务和程序,包括了
service和chkconfig)
systemctl list-unit-files|grep firewalld.service
或者
systemctl status firewalld.service
关闭防火墙:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
(2)创建用户,赋予root权限
A) useradd 用户名 (功能描述:添加新用户)
B) passwd 用户名 (功能描述:设置用户密码)
C) sudo 设置普通用户具有root权限:
a) vi /etc/sudoers
b) 修改 /etc/sudoers 文件,找到下面一行(91行),在root下面添加一行,如下
所示:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
用户名 ALL=(ALL) ALL
3.准备工作
(1)查看虚拟网络编辑器,修改相关配置
(2)复制HWADDR(MAC地址)
vim /etc/udev/rules.d/70-persistent-net.rules
(3)修改ip地址
vim /etc/sysconfig/network-scripts/ifcfg-eth0
修改文件相关的内容:
HWADDR= (1)中copy的地址
ONBOOT=yes
BOOTPROTO=static
( 以下的在虚拟网络编辑器中得到)
IPADDR=
GATWAY=
DNS1=
(4)修改主机名
vim /etc/sysconfig/network
(5)添加主机信息
vim /etc/hosts