To facilitate my work. I add
cd $working_dir
sudo su
in ~/.bashrc file.
then I could login as root and in my working dir.
But when I need run a command from remote through ssh, It is just blocked (seems like su ran and waited for an input, but I didn't get a shell).
So, the problem is:
How can I login with dir changing to working-dir and with root privilege automatically and without ssh cmd blocked?
I use pstree -a, blocked process tree shown as this:
| `-sshd
| `-sshd
| `-kbash -c pstree\040-a
| `-sudo su
| `-su
| `-kbash