Showing Bash instead of Root User Shell On CentOS / Redhat 8

This issue will occur when you deleted the bash history profile of root users that are hidden and try to switch to root bash but not able to login. In This case, the root profile not found.

This happens when you incidentally deleted the hidden files which are shown below.

Check Out: How To Disable Signup Option On Frontend Gitlab Server

.bash_history .bash_logout .bash_profile .bashrc

I logged in as user “Pankaj” in the Linux machine.

showing bash instead of

Now I will remove those hidden files using rm -rf and I deleted them now I will log in again with the user then switch to root.

Check Out: How To Show Hidden File Extension In Windows 7

As you can see there’s a bash shell instead of the root user.

root login at bash

Because files are not present here for the root user. To solve, this issue copies those files from another Linux server and paste here as hidden files.

Check Out: Check Logs of Container Running In Docker On CentOS 7

switch to root bash

Now again switch to the user Pankaj to make sure it’s working fine.

See you can see now root user instead of bash.

That’s it root profile history not found delete  history root switch to root bash root login at bash

Leave a Reply

1 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
1 Comment authors
Rahul Recent comment authors
newest oldest most voted
Notify of

Brilliant Stuff