lognameコマンドでログインしているユーザ名を表示することができます。

# logname
root