'who am i' has no output

Solution Verified - Updated -

Issue

  • The output of who am i can be useful to get the origin of a user login.
  • For example, this command prints from which IP the user logged in:

    who am i | sed -e "s/^.*(//" -e "s/)$//"
    192.168.122.1
    
  • The issue in this case is that the command who am i does not print any output:

    who am i
    <nothing>
    

Environment

  • Red Hat Enterprise Linux
  • login utmp

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content