Linux 服务器配置。

关于防火墙
1.首先无论防火墙有没有关 都使用systemctl stop firewalld 关闭防火墙
2.而后使用 yum install iptables-services 安装或更新服务
3.再使用systemctl enable iptables 启动iptables
4.最后 systemctl start iptables 打开iptables
5.试试service iptables save
6.重启防火墙 service iptables restartlinux

linux中添加帐号并设置root权限及密码
一、添加用户,首先用adduser命令添加一个普通用户,命令以下:
#adduser tommy
//添加一个名为tommy的用户
#passwd tommy //修改密码
Changing password for user tommy.
New UNIX password: //在这里输入新密码
Retype new UNIX password: //再次输入新密码
passwd: all authentication tokens updated successfully.web

二、赋予root权限bash

方法一:修改 /etc/sudoers 文件,找到下面一行,把前面的注释(#)去掉rest

## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALLtoken

而后修改用户,使其属于root组(wheel),命令以下:ip

#usermod -g root tommyio

修改完毕,如今能够用tommy账号登陆,而后用命令 su – ,便可得到root权限进行操做。table

方法二:修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,以下所示:登录

## Allow root to run any commands anywhere
root ALL=(ALL) ALL
tommy ALL=(ALL) ALLdate

修改完毕,如今能够用tommy账号登陆,而后用命令 sudo – ,便可得到root权限进行操做。

方法三:修改 /etc/passwd 文件,找到以下行,把用户ID修改成 0 ,以下所示: tommy:x:0:33:tommy:/data/webroot:/bin/bashlinux中安装JDK

相关文章
相关标签/搜索