I'm trying to mux between two ssh servers based on incoming username i.e.
ssh user1@testserver will go to one sshd instance and user2@testserver goes to another.
Can this be done?
No. Everything in an ssh session is encrypted. How do you propose the proxy would be able to snoop on the username?
I think you can do this with
in /etc/sshd/sshd_config. Here
If you only have a small, fixed set of users who you want to do this for, then you can configure it all in sshd_config with for example
But I don't know if this would correctly hook up the standard out/in of the incoming connection to standard in/out of the new ssh command.