id user

Part of the TclX package.

id user ?name?

Queries the current user name or, if name is given, sets it. Setting the user name usually requires root permission.