權限管理[Linux]

chown username file,... 改變文件的屬主(只有管理員能夠使用此命令)
-R:修改目錄及其內部文件的屬主
-reference=somefile_path file,...把想要設置屬主的文件設置成和指定路徑文件同樣的
chown username:groupname file,...
chown username.groupname file...同時修改屬主,屬組
-R
-reference=somefile_path file,...
chgrp grpname file,...修改屬組
-R
-reference=somefile_path file,...
chmod: 修改文件的權限
修改三類用戶的權限(u,g,o, a)
chmod mode file...
-R
-reference=somefile_path file,...
修改某類用戶權限
chmod 用戶類別=mode file,....
修改某類用戶的某些位權限
chmod 用戶類別+|-mode file,...( chmod u+w /tmp/helloworld/)shell

手動添加用戶(添加到三個文件)
[root@iZ28ec8xq8vZ openstack]# nano /etc/group
[root@iZ28ec8xq8vZ openstack]# nano /etc/passwd
[root@iZ28ec8xq8vZ openstack]# nano /etc/shadow
[root@iZ28ec8xq8vZ openstack]# openssl passwd -1 -salt '123456'bash

umask:遮罩號
文件 666-umask
目錄 777-umask
文件默認不能具備執行權限,若是結果具備可執行權限則解決+1
umask027code

用戶登陸Shell類型
登錄式shell:
正常經過某終端登錄的shell;
使用su -username/su -l username 登錄
非登錄式shell
su username;
圖像終端下打開的命令窗口
自動執行的shell腳本ssl

bash的配置文件openssl

  1. 全局配置
    /etc/profile,/etc/propfile.d/*.sh,/etc/bashrc
  2. 我的配置
    ~/.bash_profile,~/.bashrc
    profile類的文件:
    設定環境變量
    運行命令或者腳本
    bashrc類的文件
    設定本地變量
    定義命名別名

登錄式shll如何讀取配置文件
/etc/profile--->/etc/profle.d/.sh-->~/.bash_profile--->~/.bashrc-->etc/bashrc
非登錄式shell如何配置文件
~/.bashrc -->etc/bashrc -->/etc/profile.d/
.sh
ls -l which passwd登錄

相關文章
相關標籤/搜索