linux建立使用者唯讀許可權

2021-10-06 02:23:23 字數 1348 閱讀 9409

6.將允許執行的命令鏈結到$home/.bin目錄

第二步:在相應服務的log日誌資料夾授權

本文摘自

useradd -s /bin/bash test
這步不要指定rbash,否側cd等內建命令無法使用

passwd test
mkdir /home/test/.bin
chown root. /home/test/.bash_profile

chmod 755 /home/test/.bash_profile

[swallet@izj6c6g9pt4wd4xt1xi69zz ~]$ cat .bash_profile 

# .bash_profile

# get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi# user specific environment and startup programs

path=$path:$home/.local/bin:$home/bin

export path

切換到唯讀賬號使環境變數生效
su - test

source /home/test/.bash_profile

root賬號執行

ln -s /usr/bin/wc /home/test/.bin/wc

ln -s /usr/bin/tail /home/test/.bin/tail

ln -s /bin/more /home/test/.bin/more

ln -s /bin/cat /home/test/.bin/cat

ln -s /bin/grep /home/test/.bin/grep

ln -s /bin/find /home/test/.bin/find

ln -s /bin/pwd /home/test/.bin/pwd

ln -s /bin/ls /home/test/.bin/ls

ln -s /bin/less /home/test/.bin/less

ln -s /bin/tar /home/test/.bin/tar

chmod說明(u:與檔案屬主擁有一樣的許可權[a:所有人];+:增加許可權;rwx:可讀可寫可執行) -r:遞迴所有目錄和檔案

chmod a+rwx -r  /logs  /home/*.log

Oracle建立唯讀許可權使用者

我們使用者histest下面有很多表,需建立使用者 hongshu no1.先建立乙個使用者hongshu,密碼hongshu no2.給他一些許可權,包括連線許可權,因為他要建立同義詞,還需要給他同義詞 grant connect to hongshu grant create synonym t...

建立唯讀使用者

1.建立乙個使用者名為readonly密碼為123456的使用者 create user readonly with encrypted password 123456 2.更新使用者預設為唯讀事務 alter user readonly set default transaction read o...

mysql 建立刪除使用者並授唯讀許可權

flush privileges drop user 使用者名稱 create user 使用者名稱 identified by 密碼 grant select on 資料庫名.表名 to 使用者名稱 identified by 密碼 grant select,insert,update,delet...