Home > News Tips

Why You Can't Type Password in Terminal & How to Do That

Updated on Tuesday, August 27, 2024

Written by

Connie Yang

Approved by

Jessica Shee

English Français Deutsch やまと Español Português

You run command lines in Terminal on your Mac to do some tasks or fix some issues. However, when it prompts for a password, you find you can't type a password in Terminal.

Why? It's so ridiculous. If you have no clue and want to fix the trouble, follow this post. It will explain the reasons why you are not able to type your password in Terminal on your Mac and give you some tips.

How do you type a password in Terminal?

When you run a sudo command in the Mac Terminal, you are always required to enter your administrator password for some changes in macOS.

Typing a password in Terminal is very easy. Usually, after you type in the command line you need to execute, a prompt will appear to inform you to enter your password to enable the command to proceed. You only need to type the password and press the Enter key on your keyboard to submit permission to execute this command on this Mac.

 Note: The entered password in Terminal won't show up.

Why can't you type a password in Terminal?

The most common reason is that the entered password doesn't show up in the Terminal when you type it for security reasons, leading you to mistakenly think that you can't type a password in the Terminal.

Also, it can't exclude that some of the keys on your keyboard are broken, so you actually can't enter a correct password in the Terminal. But whenever you enter a wrong password or actually type nothing, the Terminal window always alerts you to type again.

Sometimes, the Terminal suddenly stops working, has temporary errors, or is interfered with by other tools, also making you fail to enter your password either.

Go to tell more people why they can't type a password in the Terminal.

 

Can't type a password in Terminal, what to do?

If you can't type a password in Terminal, you can try the basic checks and tricks in this part.

Check your way to enter the password

When the Terminal prompts you to enter your password, directly type in your password and hit Enter. By default, the password won't appear on the Terminal window. So you don't need to be confused about the password not showing up.

Usually, if your password is entered correctly, the action will continue. If not, it will hint you to re-enter the password once more.

Check if the keyboard is damaged

If you mean you can't type a sudo password in the Terminal as it lets you enter the password again and again, the keyboard is probably damaged. Some of the keys related to your password are not working.

You can open a text or document and enter your password to see if it can be typed. If some of the keys are missing, it means that these keys on the keyboard are broken. You can change a keyboard if had or use the on-screen Accessibility Keyboard on your Mac.

Click the Input menu on the menu bar and then select Show Keyboard Viewer. If you can't find the Input menu, click the Apple menu > System Settings > Accessibility > Keyboard. Then, select Viewer and tick in Enable Accessibility Keyboard.

Relaunch Terminal

If the Terminal temporary errors make you can't type a password, you can quit Terminal and then relaunch it. Then, enter your command again to see if it prompts and allows you to enter the password this time.

Close third-party command-line tools

You may run a third-party command-line program at the same time, which interferes with your work on the Terminal. Close the third-party command-line apps and then check if you can enter a password in the Terminal.

Restart your Mac

The temporary errors in the system can lead to abnormal performance, such as the failure to enter a password in the Terminal. You can restart your Mac to verify if the temporary system bugs cause this problem.

Update your Mac

If the above solutions can't help you out, the reason why you can't enter the sudo password in Terminal on your Mac is probably the software issue in the current version. You can update your Mac to the latest minor version as the system update always contains bug patches. After that, the Terminal will perform properly.

If this post helps you out of the dilemma, share it to help others who also run into the same issue.