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.
sudo -i
to go to a root prompt ;-) – Rinzwind Jul 25 '19 at 08:29sudo -i
instead ofsudo su -
? – beingadityak Jul 25 '19 at 08:30/etc/shadow
file? This happened when I performed the switch to root using the mentioned command – beingadityak Jul 25 '19 at 08:36webadm-dev
probably is defined somewhere in your control panel. Unfortunately I haven't any experience with this cloud provider and can't provide further help. – pa4080 Jul 25 '19 at 10:23su
actually changed to a non-root user, or whether it was just an issue with thePS1
prompt string. – steeldriver Jul 25 '19 at 11:46PS1
, I checkedwhoami
and it showed non-root user in the root prompt – beingadityak Jul 26 '19 at 05:51