misOrz

IT Tech & Life

Change root password using sed

1. Generate new root password & Su2Root

# openssl passwd -1 -salt root hello123

2. Replace first line in shadow file

# sed -i '1c root:$1$root$wrNKG1lgeNwlb0I1oJbR9/.:19613:0:99999:7:::' /etc/shadow