How to change root password on macOS Unix using terminal
To change the root password on macOS using the terminal, you can use the dscl command. Here are the steps:
- Open the Terminal application on your macOS system.
- Type the following command and press Enter:
sudo dscl . -passwd /Users/root- You will be prompted to enter the new password for the root user.
- Enter the new password and press Enter. You will not see any characters as you type the password.
- Re-enter the new password to confirm it, and press Enter.
- The password for the root user has been successfully changed.
Also, remember to keep your system up to date, in order to have the latest security patches and bug fixes.
