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
完成!