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

相關文章
相關標籤/搜索