su - username command doesn't act as expected

186 Views Asked by At

I am trying to switch to another user using su command, but it doesn't work as expected.

What I am expecting:

[root@ubuntu ~]# su testuser
[testuser@ubuntu root]#

What actually happens:

[root@ubuntu ~]# su testuser
bash-4.2$

whoami command:

bash-4.2$ whoami
testuser
1

There are 1 best solutions below

1
sweintritt On BEST ANSWER

The testuser might not have the same bash configuration. So the prompt might look different. Check the current user with whoami after you switched the user.