rootsh running issue in normal user

Solution 1:

What's happening here is that you are getting caught in a loop - have a look at this output from pstree

sshd───bash───rootsh───bash───rootsh───bash───rootsh...

Each time you run bash, it runs .bashrc which runs rootsh which is a wrapper around bash so it runs bash which runs .basrc ...

You could put the invocation in .bash_profile, then it will only run for login shells

~/.bash_profile
      The personal initialization file, executed for login shells
~/.bashrc
      The individual per-interactive-shell startup file

And the output from pstree with this in place

sshd───bash───rootsh───bash───pstree

Don't use rootsh -i though in your .bash_profile.