歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux下設置用戶密碼

Linux下設置用戶密碼

日期:2017/2/28 15:56:11   编辑:Linux教程

安裝expect包:

[[email protected] ]$ yum install expect -y

[[email protected] ]$

[[email protected] ]$ whereis mkpasswd

mkpasswd: /usr/bin/mkpasswd /usr/share/man/man1/mkpasswd.1.gz

用mkpasswd生成隨機密碼:

[[email protected] ~ 8]$ mkpasswd -l 10 -C 4 -d 3

-l 表示密碼長度

-C 表示至少包含幾個大寫字母

-d 表示至少包含幾個數字

用passwd命令重置root密碼:

[[email protected] ~ 9]$ passwd root

Copyright © Linux教程網 All Rights Reserved