linux帳號管理及開機流程簡介

來源:互聯網
上載者:User

 
 
帳號管理
/etc/passwd         系統帳號資訊
/etc/shadow         帳號密碼資訊         經MD5   32位加密
          在密碼欄前面加『   *   』『   !   』禁止使用某帳號
/etc/group           系統群組資訊
/etc/gshadow
newgrp         改變登陸組
useradd     &     adduser         建立新使用者     --------->   useradd   -m   test     自動建立使用者的登入目錄
                    useradd   -m   -g   pgroup   test   ---------> 指定所屬級
/etc/default/useradd       相關設定
/etc/login.defs               UID/GID   有關的設定
passwd         更改密碼   ----------->   passwd   test
usermod       修改使用者帳號
userdel       刪除帳號   -----------> userdel   -r   test
chsh             更換登陸系統時使用的SHELL       [-l]顯示可用的SHELL;[-s]修改自己的SHELL
chfn             改變finger指令顯示的資訊
finger         尋找並顯示使用者資訊
id                 顯示使用者的ID   ----------->     id   test
groupadd       添加組
groupmod       與usermod類似
groupdel       刪除群組
su   test         更改使用者       su   -         進入root,且使用root的環境變數
sudo               以其他身份來執行指令
visudo           編輯/etc/sudoers             加入一行『   test   ALL=(ALL)   ALL   』
                      %wheel   ALL   =   (ALL)   ALL                               系統裡所有wheel群組的使用者都可用sudo
                      %wheel   ALL   =   (ALL)   NOPASSWD:   ALL           wheel群組所有使用者都不用密碼NOPASSWD
              User_Alias   ADMPW   =   vbird,   dmtsai,   vbird1,   vbird3                   加入ADMPW組
              ADMPW   ALL   =   NOPASSWD:   !/usr/bin/passwd,   /usr/bin/passwd   [A-Za-z]*,   /
              !/usr/bin/passwd   root             可以更改使用者密碼,但不能更改root密碼   (在指令前面加入   !   代表不可)
PAM   (Pluggable   Authentication   Modules,   嵌入式模組)
who   &   w           看誰線上                                          
last                 最近登陸主機的資訊
lastlog           最近登入的時間         讀取   /var/log/lastlog  
talk                 與其他使用者交談
write               發送資訊         write   test       [ctrl]+d   發送
mesg                 設定終端機的寫入許可權         mesg   n   禁止接收           mesg   y  
wall                 向所有使用者發送資訊         wall   this   is   q   test
mail                 寫mail      
/etc/default/useradd         家目錄預設設定
quota             顯示磁碟已使用的空間與限制           quota   -guvs   -----> 秀出目前   root   自己的   quota   限制值
                      quota   -vu       查詢
quotacheck       檢查磁碟的使用空間與限制           quotacheck   -avug     -----> 將所有的在   /etc/mtab   內,含有   quota   支援的   partition   進行掃瞄
                          [-m]   強制掃描    
          quota一定要是獨立的分區,要有quota.user和quota.group兩件檔案,在/etc/fstab添加一句:
          /dev/hda3   /home   ext3   defaults,usrquota,grpquota   1   2
          chmod   600   quota*                   設定完成,重啟生效
edquota         編輯使用者或群組的quota     [u]使用者,[g]群組,[p]複製,[t]設定寬限期限  
                      edquota   -a   yang               edquota   -p   yang   -u   young   -----> 複製        
quotaon         開啟磁碟空間限制           quotaon   -auvg   --------> 啟動所有的具有   quota   的   filesystem
quotaoff       關閉磁碟空間限制           quotaoff   -a     --------> 關閉了   quota   的限制
repquota   -av           查閱系統內所有的具有   quota   的   filesystem   的限值狀態
Quota   從開始準備   filesystem   的支援到整個設定結束的主要的步驟大概是:
1、設定   partition   的   filesystem   支援   quota   參數:
由於   quota   必須要讓   partition   上面的   filesystem   支援才行,一般來說,   支援度最好的是   ext2/ext3   ,
其他的   filesystem   類型鳥哥我是沒有試過啦!   啟動   filesystem   支援   quota   最簡單就是編輯   /etc/fstab   ,
使得準備要開放的   quota   磁碟可以支援   quota   囉;
2、建立   quota   記錄檔:
剛剛前面講過,整個   quota   進行磁碟限制值記錄的檔案是   aquota.user/aquota.group,  
要建立這兩個檔案就必須要先利用   quotacheck   掃瞄才行喔!
3、編輯   quota   限制值資料:
再來就是使用   edquota   來編輯每個使用者或群組的可使用空間囉;
4、重新掃瞄與啟動   quota   :
設定好   quota   之後,建議可以再進行一次   quotacheck   ,然後再以   quotaon   來啟動吧!

開機流程簡介
1、載入   BIOS   的硬體資訊,並取得第一個開機裝置的代號;  
2、讀取第一個開機裝置的   MBR   的   boot   Loader   (亦即是   lilo,   grub,   spfdisk   等等)   的開機資訊;  
3、載入   Kernel   作業系統核心資訊,   Kernel   開始解壓縮,並且嘗試驅動所有硬體裝置;  
4、Kernel   執行   init   程式並取得   run-level   資訊;  
5、init   執行   /etc/rc.d/rc.sysinit   檔案;  
6、啟動核心的外掛模組   (/etc/modprobe.conf);  
7、init   執行   run-level   的各個批次檔(   Scripts   );  
8、init   執行   /etc/rc.d/rc.local   檔案;  
9、執行   /bin/login   程式,並等待使用者登入;  
10、登入之後開始以   Shell   控管主機。  
在/etc/rc.d/rc3.d內,以S開頭的為開機啟動,以K開頭的為關閉,接著的數字代表執行順序
GRUB   vga設定
彩度/解析度     640x480     800x600     1024x768     1280x1024       bit  
        256                 769             771             773               775             8   bit  
      32768               784             787             790               793           15   bit  
      65536               785             788             791               794           16   bit  
      16.8M               786             789             792               795           32   bit  

./configure         檢查系統資訊               ./configure   --help   |   more     協助資訊
make   clean           清除之前留下的檔案
make                       編譯
make   install       安裝
rpm   -q     -----> 查詢是否安裝                           rpm   -ql   ------> 查詢該套件所有的目錄
rpm   -qi   -----> 查詢套件的說明資料               rpm   -qc[d]   -----> 設定檔與說明檔
rpm   -ivh     ----> 安裝                                         rpm   -V     --------> 查看套件有否更動過
rpm   -e     ------> 刪除                                         rpm   -Uvh   -------> 升級安裝    
--nodeps   -----> 強行安裝                                 --test   -----> 測試安裝

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.