The USER env variable is unchanged after gaining root access.
[user1@comp]$ echo $USER user1
Logged in the system as 'user1'. Now check the output after gaining root access.
[user1@comp]$ su Password: [root@comp]# echo $USER user1
If I were to login as 'root' user, then USER env is set to 'root'. There is no issue there. This behavior was observed in Fedora and CentOS. Why is the env variable not updated?