When you're logged in to your Mac using an administrator account, you can use the
sudo command in the Terminal app to execute commands as a different user, such as the root user. After you enter the command, Terminal asks you to enter your account password. If you’ve forgotten your password or your account doesn't have a password, add or change your password in Users & Groups preferences. You can then execute
sudo commands in Terminal.
Terminal doesn't show the password as you type. If you enter the wrong password or a blank password, the command isn't executed and Terminal asks you to try again.