Home » Tech Tips » Mac » How to Find Who Logged Into Your Mac?

How to Find Who Logged Into Your Mac?

Worried that someone may have used your Mac without permission? macOS provides several ways to check recent login activity, including Terminal commands that show when user accounts logged in and whether a session occurred locally or remotely. You can also use the Console app and macOS unified logs to investigate authentication and login-related events in more detail. This article explains how to check login history on a Mac and what to look for if you suspect unauthorized access.

1. Using Last Command in Mac Terminal

You can scan through all system log activities in Mac using Console app (as explained in the next option). However, analyzing the logs is a difficult task and you can use the Terminal app to easily view all login history.

  • Go to “Finder > Applications > Utilities” and open Terminal app.
  • Simply type last and press enter to display a list of all users who have logged in to the system.
  • Depending on the type of session, you may see information such as username, terminal or session type (like ttys000), remote host or IP address, login time, logout time, and session duration.
  • Instead of seeing all the entries, you can restrict the number of items using the following format (this will show last 10 items).
last -n 10
Last Command Results in Terminal
Last Command Results in Terminal

Recent entries normally appear first and the reboot entry represents a system restart rather than a user login. If you are mainly interested in finding out when somebody logged into the Mac normally through its graphical login screen, filter the output for console:

last | grep console

This is one of the most useful commands for a typical Mac owner investigating login activity. It removes many unrelated entries and concentrates on graphical console sessions. You can make the output even more specific by searching for a particular username (replace USERNAME with the Mac account name you want to investigate).

last | grep "^USERNAME"

Understanding the Output of the last Command

The output from last may contain several types of entries and here are some common items with their meaning:

  • console – normally represents a graphical user session on the Mac. For someone investigating whether another person used the computer locally, these are usually the most interesting entries.
  • ttys and Other Terminal Sessions – entries involving terminal devices represent terminal-based sessions rather than ordinary graphical desktop logins. Remote shell connections, terminal sessions, and other command-line activity can produce different session entries depending on how the connection was established.
  • still logged in – the session has not yet recorded a logout, which may simply be your current Mac session.
  • reboot – represents a system startup or restart. It does not mean a user named “reboot” logged into the computer.
  • shutdown – A shutdown entry represents the computer being shut down rather than a user login.

2. Check Login Events with the Console App

macOS includes a graphical log viewer called Console for viewing log messages generated by your Mac and connected devices.

  • Go to “Finder > Applications > Utilities” and open the Console app.
  • Select your Mac in the “Devices” section if necessary (from the left sidebar) and click the “Activities” button on the top.
  • Click “Start streaming” link if Console is not currently displaying messages.
Start Streaming in Console
Start Streaming in Console
  • You can then use the search box to search the available log messages. Type the search terms like login, loginwindow, authentication, or authorization in search box on top right corner to filter the relevant items.
  • After filtering, select an item to view its details at the bottom.
Search for Login Activities
Search for Login Activities

Keep in mind that modern macOS generates a very large number of system messages. Searching for the word login does not automatically produce a clean list of user login history. Console is therefore better suited to troubleshooting or investigating a particular time period than simply answering “when did this user log in?” For a quick login history, the last command is usually easier.

3. Search macOS Logs from Terminal

Modern versions of macOS use Apple’s unified logging system. The log command allows you to search these records directly from Terminal. For example, you can search messages from the last 24 hours containing the word login:

log show --last 1d --predicate 'eventMessage CONTAINS[c] "login"'

The [c] makes the search case-insensitive. Be prepared for a large amount of output because many macOS processes use login-related terminology (press Control + C to terminate the command). You can also change the time period in the command like --last 2h to restrict the search scope. For example, you can use the following command to search for authentication-related messages for the past 3 hours.

log show --last 3h --predicate 'eventMessage CONTAINS[c] "authentication"'

The loginwindow process is involved in graphical login and user-session management on macOS. You can search recent messages associated with it using:

log show --last 1d --predicate 'process == "loginwindow"'

This can provide additional information when investigating activity around a particular login or logout time. However, the output is considerably more technical and should not be interpreted as a straightforward list of successful user logins. You can always start with last command and use unified logs only when further investigation is necessary.

4. Use Screen Time to Check User Activity

Older versions of macOS included a separate Parental Controls feature. On current versions of macOS, parental management features are primarily provided through Screen Time.

  • Go to “Apple menu > System Settings > Screen Time”.
  • If you use Family Sharing as a parent or guardian, you can select a family member and review their Screen Time information.
  • Depending on your configuration, Screen Time can show app and website activity and how long apps were used.
  • This can sometimes provide useful supporting information. For example, if Screen Time shows applications being actively used during a period when you believe nobody should have been using the Mac, you may want to investigate further.
Screen Time Usage on Mac
Screen Time Usage on Mac

However, Screen Time is not a security login log and it should not be used as a replacement for Terminal login records when determining exactly when an account logged into the Mac. Also, Screen Time activity needs to be enabled for the relevant usage information to be available.

How to Spot Suspicious Login Activity on a Mac?

A login record by itself does not necessarily indicate unauthorized access. Compare the username, timestamp, session type, and available remote information with your normal Mac usage. Things worth investigating include:

  • Console logins at times when you were away.
  • Logins involving unfamiliar user accounts.
  • Unexpected remote sessions.
  • Remote Login being enabled when you never enabled it.
  • Screen Sharing or Remote Management being enabled unexpectedly.
  • Repeated authentication failures associated with remote services.
  • New administrator accounts you do not recognize.

If the available evidence indicates that someone accessed your Mac without permission:

  • Review your Apple Account for devices you do not recognize, change your Apple Account password if necessary, and make sure two-factor authentication is enabled.
  • Go to “Apple menu > System Settings… > Users & Groups” and look for unknown user accounts (particularly accounts with administrator privileges) and remove them.
  • Then go to “Apple menu > System Settings… > General > Sharing” and disable Remote Login, Screen Sharing, Remote Management, and other sharing services you do not need.
  • Finally, install available macOS security updates from ” Apple menu > System Settings… > General > Software Update” section.

If you find an unfamiliar administrator account or other strong evidence of unauthorized access, consider reviewing installed applications and login items as part of a broader security check.

Frequently Asked Questions

1. How can I check failed login attempts on a Mac?

Finding failed login attempts on modern macOS is more complicated than checking successful login sessions. Unlike Windows, which uses Event ID 4625 for failed logins, macOS does not provide a single Terminal command that reliably lists every type of failed authentication attempt. You can search recent macOS unified logs for failure-related messages using log show –last 1d –predicate ‘eventMessage CONTAINS[c] “failed”‘. This searches logs from the last 24 hours for messages containing the word “failed”. However, not every result indicates a failed password or login attempt. Many macOS services and applications generate messages containing “failed” for unrelated reasons. Check the surrounding message, process, username, and timestamp before treating an entry as suspicious.

2. Can I see the IP address of someone who logged into my Mac?

For a normal graphical login performed directly on the Mac, there is no remote IP address because the user is physically accessing the computer. For remote connections, such as SSH sessions, login records may contain a hostname or IP address depending on the service used and how the connection was established. If you find an unfamiliar remote address, investigate it together with the username, login time, and remote service involved. An unfamiliar IP address alone is not proof of unauthorized access.

3. How far back does Mac login history go?

macOS does not guarantee that login history will be retained for a specific number of days. How much history is available depends on the type of log, system activity, log rotation, available storage, and macOS configuration. The last command can only display login records that are still retained by the system. Similarly, macOS unified logs are retained for a limited period. Older records are eventually removed, so login activity from several weeks or months ago may no longer be available.

Leave a Comment

Your email address will not be published. Required fields are marked *