ssh through a .php, backdoor
I have an apache + php server running and I want to install a backdoor. I am the root of the server, but I want to have a backdoor in case I lose root password or somebody hacks me. So, I was thinking to install a .php script somewhere deep down under DOCUMENT_ROOT that does exec() of some command that would convert the 'httpd' process into 'sshd' process but leaving the filedescriptor of open connection on port 80. On the client side, I would use my own program made in C , that would telnet to port 80 and also exec() ssh client. So my question is, is it possible to take a web connection and replace it with ssh on both ends ?
Would be this too difficult? Have someone did something like this?
Thanks in advance.