I was trying to perform some root-level action on my Ubuntu server. When I switched to the root user, I found that the username is different. I usually switch to the root user with the following command:
sudo su -
But the prompt was showing as a different user: webadm-dev. I checked on the /etc/shadow if anyone tried to add some user and I found nothing. I tried to switch to the root user (after switching back to the logged in user) with the following:
sudo su - root
It got changed. I exited back and tried to run my usual command again:
sudo su -
and the username is changed back to the root user. I am not able to understand the behavior of this command and this weird change. Please help!
EDIT 1: The behavior of the user change in root prompt was only once and was never seen again.