Which password does Terminal require

Which password do I need to type into Terminal, my Apple ID password, my MacBook Pro password, or something else? I've tried both and it's not correct.

MacBook Pro 14″, macOS 13.4

Posted on Jun 12, 2023 2:16 PM

Reply
Question marked as Top-ranking reply

Posted on Jun 12, 2023 2:24 PM

25reasons wrote:

Which password do I need to type into Terminal, my Apple ID password, my MacBook Pro password, or something else? I've tried both and it's not correct.


Terminal.app provides access to a command shell; to the command line. That command shell is either the zsh or the bash command shell, lately.


What password is needed depends on what you are doing.


If you are entering a sudo command for instance, that command (by default) requires the macOS login password for the current user, and that user must be a member of the admin group.


If entering an ssh password, that’s the login password for the remote server you’re attempting to log into.


Terminal app itself does not (by default) require a password to launch.


What is the context? What’s the command?

14 replies
Question marked as Top-ranking reply

Jun 12, 2023 2:24 PM in response to 25reasons

25reasons wrote:

Which password do I need to type into Terminal, my Apple ID password, my MacBook Pro password, or something else? I've tried both and it's not correct.


Terminal.app provides access to a command shell; to the command line. That command shell is either the zsh or the bash command shell, lately.


What password is needed depends on what you are doing.


If you are entering a sudo command for instance, that command (by default) requires the macOS login password for the current user, and that user must be a member of the admin group.


If entering an ssh password, that’s the login password for the remote server you’re attempting to log into.


Terminal app itself does not (by default) require a password to launch.


What is the context? What’s the command?

Jun 12, 2023 3:33 PM in response to 25reasons

25reasons wrote:

Thanks again. I'm following Siteground's instructions to test a WordPress site that's just been migrated across to them.


Yuck. Okay. The macOS login password is the password needed for sudo.


Do you know your macOS login password, or do you need to reset it? (To reset, see the links included above.)


(Resetting your macOS login password will mean you will no longer have access to any passwords stored in Keychain.)

Jun 12, 2023 2:45 PM in response to 25reasons

25reasons wrote:

Oh I see, thank you.

The command is sudo nano /private/etc/hosts

I've just found an article which tells me how to find my password. It says to do this:

How do I find my Mac administrator password using Terminal?
Here's how to do that:1.
Restart your Mac. ...
2. While it is restarting, press and hold the Command + R keys until you see the Apple logo. ...
3. Go to the Apple Menu at the top and click Utilities. ...
4. Then click Terminal.
5. Type “resetpassword” in the terminal window. ...
6. Then hit Enter. ...
7. Type your password and a hint. ...
8. Finally, click Restart.

Is that correct?


I’m confused. Where are you headed with this? What’s your goal?


The /etc/hosts file is not related to a password reset.


Which macOS version?


For a forgotten-password on macOS, I’d follow this: https://support.apple.com/en-us/HT202860


and then this: https://support.apple.com/en-us/HT212190


There are various reasons for modifying /etc/hosts but some caution should be used. Depending on the context, some cracked apps and some malware apps do request users modify that file when installing the apps—and the cracked apps themselves too often tend to contain malware. I am aware of some folks that use that dile as a form of ad blocking, but that tends to get clunky. Setting up names for a local network is another, but Bonjour / mDNS works pretty well for that without requiring modifications.


If you are taking over a new Mac from its previous owner, there is a reset procedure the owner should follow. not following the reset will cause all sorts of problems when trying to update apps and macOS itself.


Here is: What to do before you sell, give away, or trade in your Mac - Apple Support


Jun 12, 2023 2:27 PM in response to MrHoffman

Oh I see, thank you.


The command is sudo nano /private/etc/hosts


I've just found an article which tells me how to find my password. It says to do this:


How do I find my Mac administrator password using Terminal?

Here's how to do that:

  1. Restart your Mac. ...
  2. While it is restarting, press and hold the Command + R keys until you see the Apple logo. ...
  3. Go to the Apple Menu at the top and click Utilities. ...
  4. Then click Terminal.
  5. Type “resetpassword” in the terminal window. ...
  6. Then hit Enter. ...
  7. Type your password and a hint. ...
  8. Finally, click Restart.


Is that correct?

Jun 12, 2023 3:59 PM in response to MrHoffman

Yes I am, so I don't understand why I can't use my password on Terminal? Maybe I'm trying to enter it incorrectly?


At the password prompt, there's a key icon, so I can't actually get my cursor there, which I think is the way it's supposed to be, right? So I simply start typing my password and then press enter, even though I can't see what I'm typing. But it comes back saying Sorry try again.


I really appreciate your help with this! Thank you so much :)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Which password does Terminal require

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.