Linux (CentOS)增加刪除使用者

來源:互聯網
上載者:User

標籤:

在Linux終端下如何增加刪除普通使用者帳戶
想瞭解Linux下的使用者資訊,主要兩個檔案:/etc/passwd和/etc/shadow

今天主要講一下用命令建立和刪除使用者

增加使用者
一般是兩個步驟,增加使用者名稱和指定使用者密碼

[[email protected] /]# useradd test2[[email protected] /]# passwd test2Changing password for user test2.New UNIX password:BAD PASSWORD: it does not contain enough DIFFERENT charactersRetype new UNIX password:passwd: all authentication tokens updated successfully.#下面這個命令是為使用者指定家目錄的[[email protected] home]# useradd test5 -d /home/t#更多詳細的參數man useradd


刪除使用者
刪除使用者比較簡單,預設不加參數,不會把使用者的家目錄刪除,
要刪除家目錄的時候,要加上-r參數

#預設沒有刪除家目錄[[email protected] home]# userdel test2[[email protected] home]# ls /homelele  swap  t  t4  test2  test3#加上-r參數可以把家目錄也一併刪除[[email protected] home]# useradd test6[[email protected] home]# ls /homelele  swap  t  t4  test2  test3  test6[[email protected] home]# userdel -r test6[[email protected] home]# ls /homelele  swap  t  t4  test2  test3

Linux (CentOS)增加刪除使用者

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.