Fork me on GitHub
Jason Antman's Blog
  • About Me
  • AWS
  • Software
  • Hardware
  • DIY / Home Automation / Security
  • Miscellaneous
  • Tags
  • Archives

How to get actual login username when using sudo su

Date Wed 05 January 2011 Tags linux / login / sudo / username

I’ve had the need to find out the actual username of someone logged in and working as root (via sudo su -) to put it into a subversion commit message. This quick little bash script does the trick, and just echos the username.

#!/bin/bash

PID=$$ # get PID of current …
more ...

  • Recent Posts

    • How to get actual login username when using sudo su
  • Latest Tweets

    Tweets by j_antman
  • GitHub Repos

    Status updating...

    @jantman on GitHub
  • Links

    • Homepage
    • Resume

© 2011 Jason Antman · Powered by pelican-bootstrap3, Pelican, Bootstrap

Back to top