首页
/
每日頭條
/
生活
/
linux系統中修改密碼
linux系統中修改密碼
更新时间:2024-10-05 01:14:27

平時我們使用Linux修改用戶密碼時候經常使用命令為`passwd 用戶名`,這種命令一般需要連續輸入兩次同樣的密碼,有些時候我們需要僅僅輸入一條命令就可以更改用戶的密碼,增加工作效率,本篇将簡單介紹幾種一條命令更改用戶密碼的方式。

操作過程

1.準備環境,首先我們使用root賬号登錄操作系統,并使用命令‘useradd test1’創建test1賬号,具體操作如下圖所示。

linux系統中修改密碼(Linux一條命令更改密碼)1

2.使用普通命令方式進行設置test1密碼,輸入指令‘passwd test1’進行設置用戶密碼,具體操作如下圖所示。

linux系統中修改密碼(Linux一條命令更改密碼)2

3.使用命令'echo "12345678"|passwd --stdin test1'來将test1的密碼修改為12345678,具體操作如下圖所示。

linux系統中修改密碼(Linux一條命令更改密碼)3

4.使用命令'echo test1:87654321 | chpasswd'來将test1的密碼更改為87654321,具體操作如下圖所示。

linux系統中修改密碼(Linux一條命令更改密碼)4

,
Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
Copyright 2023-2024 - www.tftnews.com All Rights Reserved