VMware安装虚拟机后的初始配置

1.让普通用户执行sudo


1.使用”su”命令切换到root角色
2.编辑sudoers文件

vi /etc/sudoers


3.找到权限那一行并加入新的用户授权

root    ALL=(ALL)   ALL
llj     ALL=(ALL)   ALL

2.让linux系统启动时不启动图形界面(可以省略)


1.编辑inittab文件

sudo vi /etc/inittab


2.将启动级别改成3

id:3:initdefault:


3.保存退出

3.修改网络配置

vim /etc/sysconfig/network-scripts/ifcfg-eth0


需要修改或添加的选项有:

BOOTPROTO="static"
IPADDR="192.168.1.X"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
DNS1=8.8.8.8
DNS2=8.8.4.4

修改完成之后,重启网络服务(或者reboot重启服务器)

sudo service network restart

4.修改主机名

vim /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=*******(自定义)


修改之后进行保存退出(重启后生效)

5.修改主机–ip映射

sudo vi /etc/hosts

添加

ip地址1   主机名1
ip地址2   主机名2
...

6 关闭防火墙

查看防火墙状态

service iptables status

关闭防火墙

service iptables stop

关闭后使用命令 service iptables status
显示:iptables: Firewall is not running. 关闭成功!

查看防火墙开机启动状态

chkconfig iptables --list

关闭防火墙开机启动

chkconfig iptables off

再次使用命令chkconfig iptables --list查看防火墙状态

如果看到这样的状态,那么恭喜你,防火墙成功关闭!

7 关闭SElinux

使用命令getenforce查看是否开启
enforcing表示开启,还没有关闭

编辑文件 /etc/selinux/config

/etc/selinux/config

修改SELINUX=disabled

# 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 - SELinux is fully disabled.

SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

重启Linux

    reboot

一些可选的安装:

vsftpd服务:是一种sftp,便于使用第三方软件进行日志文件的查看:
安装命令:

yum -y install vsftpd.x86_64

安装完成后进行启动

service vsftpd start

设置开机启动

chkconfig vsftpd on

完成!

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值