歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> UNIX和Linux系統添加用戶的方法介紹

UNIX和Linux系統添加用戶的方法介紹

日期:2017/2/27 9:52:03   编辑:更多Linux

創建新的帳號有幾種方法. 我們將使用最基本的方法; useradd命令. 基本上, 所有您要輸入的(記住,作為root!)就是:

[root@bigdog /root]# useradd blarg

[root@bigdog /root]#

好, 現在讓我們登錄:

Red Hat Linux release 5.1 (Manhattan)

Kernel 2.0.34 on an i586

login: blarg

PassWord:

Login incorrect

login:

因為不知道blarg的口令, 我們只是按[Enter]. 那不是正確的口令. 那麼, 您為新的帳號分配的口令是什麼呢?

#口令

passwd命令可以用來:

為新創建的用戶分配口令.

修改已存在的用戶的口令.

修改您登錄的用戶的口令.

前兩種情況實際上是一樣的; 一個新創建的用戶和一個已存在五年的用戶沒什麼區別(至少對passwd是這樣). 記住您必須以root登錄, 並且您必須哪個帳戶的口令是您想修改的. 用我們剛才創建的帳號, 來試一下passwd:

[root@bigdog /root]# passwd blarg

New UNIX password:

Retype new UNIX password:

passwd: all authentication tokens updated sUCcessfully

[root@bigdog /root]#

您可能已經猜到, 口令不會顯示出來. 您還必須輸入兩次口令, 以確保您沒有輸錯. 讓我們再來試一下用新帳號登錄:

Red Hat Linux release 5.1 (Manhattan)

Kernel 2.0.34 on an i586

login: blarg

Password:

[blarg@bigdog blarg]$

一旦您登錄了一個帳號, 您可以用passwd命令來修改口令. 這時會詢問您當前的口令, 然後是新口令:

[blarg@bigdog blarg]$ passwd

Changing password for blarg

(current) UNIX password:

New UNIX password:

Retype new UNIX password:

passwd: all authentication tokens updated successfully

[blarg@bigdog blarg]$

就這麼簡單。




Copyright © Linux教程網 All Rights Reserved