Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 372 Bytes

File metadata and controls

21 lines (13 loc) · 372 Bytes

Changing User Password In Shell Script

In order to change in shell scripts, we have two options which are given below.

Option 1

Using passwd

echo -e "{NEW_PASSWORD}\n{NEW_PASSWORD} | passwd {USER}

Option 2

Using chpasswd

echo "{USER}:{NEW_PASSWORD} | chpasswd

Source: StackOverFlow