使用普通使用者替代root來管理IEE

2021-09-07 05:27:18 字數 2617 閱讀 6804

環境:rhel 6.4 + iee 4.0.6

需求:iee資料庫之前是使用root使用者部署和管理的,現在安全加固,將資料庫交給普通使用者iee來管理。

一、當前環境

二、安全加固

iee資料庫安裝嚮導:

根據當前的iee程序確定那些檔案/資料夾許可權需要修改:

[root@jingyudb ~]# ps -ef|grep mysql|grep -v grep

[root@jingyudb ~]# ls -lh /etc/my-ib.cnf

-rw-r--r--. 1 root root 2.2k jan 27 16:08 /etc/my-ib.cnf

[root@jingyudb ~]# ls -lh /etc/init.d/mysqld-ib

-rwxr--r--. 1 root root 14k sep 9 2013 /etc/init.d/mysqld-ib

drwxr-xr-x. 4 root root 4.0k jan 27 16:09 iee

[root@jingyudb ~]# ls -lh /usr/local|grep infobright

drwxr-xr-x. 11 root root 4.0k jan 27 16:09 infobright-4.0.6-x86_64

上面用到的命令列表:

--查詢iee程序,根據mysql關鍵字

ps -ef|grep mysql|grep -v grep

--根據程序可以看到相關的各個檔案/資料夾

ls -lh /etc/my-ib.cnf

ls -lh /etc/init.d/mysqld-ib

ls -lh /usr/local|grep infobright

root使用者建立iee使用者並設定iee使用者密碼:

useradd iee

passwd iee

root使用者關閉資料庫:

/etc/init.d/mysqld-ib stop
chown iee:iee /etc/my-ib.cnf

chown iee:iee /etc/init.d/mysqld-ib

chown -r iee:iee /usr/local/infobright-4.0.6-x86_64

使用iee使用者登入主機啟動資料庫:

/etc/init.d/mysql-ib start
此時再次檢視iee程序,確定程序已由普通使用者iee管理控制:

[iee@jingyudb ~]$ ps -ef|grep mysql|grep -v grep
mysql-ib登入進iee資料庫,驗證資料確定沒有問題:

[iee@jingyudb ~]$ mysql-ib

welcome to the mysql monitor. commands end with ; or \g.

your mysql connection id is 8

server version: 5.1.40 build number (revision)=ib_4.0.6_r16086_16275(iee - commercial) (static)

type 'help;' or '\h' for help. type '\c' to clear the current input statement.

mysql> show databases;

+--------------------+

| database |

+--------------------+

| information_schema |

| bh_rsi_repository |

| jingyu |

| mysql |

| sys_infobright |

| test |

+--------------------+

6 rows in set (0.01 sec)

mysql> use jingyu

database changed

mysql> show tables;

+------------------+

| tables_in_jingyu |

+------------------+

| t1 |

| t1 |

+------------------+

2 rows in set (0.00 sec)

mysql> select count(1) from t1;

+----------+

| count(1) |

+----------+

| 4 |

+----------+

1 row in set (0.00 sec)

mysql>

至此,完成iee資料庫交付給普通使用者iee來管理維護。

普通使用者 非root 使用nginx

適用於使用rpm安裝的nginx 系統centos7 新增nginx安裝源 rpm ivh 安裝nginx yum install y nginx 啟動nginx和配置nginx開機啟動 service nginx start chkconfig nginx on 由於nginx需要使用的預設埠號是...

賦予普通使用者root許可權

1 新增使用者,首先用adduser命令新增乙個普通使用者,命令如下 adduser tom 新增乙個名為tom的使用者 passwd tom 修改密碼 changing password for user tom.new unix password 在這裡輸入新密碼 retype new unix...

普通使用者切換為root使用者

su 命令可以將普通使用者切換為root使用者 如下是從當前的admin使用者切換為root使用者 admin localhost su 輸入root使用者密碼 root localhost 如上,使用者從admin切換為root了,而且提示符也有改變 是超級使用者提示符,是普通使用者提示符 要切換...