Please don't. Managing SSH sensibly (with checking keys properly) in any
greater scale is awful. SSH was never meant for general communication, which
reflects how it operates on implementation level and on protocol level. SSH
servers require usable home directory locally and remotely (OpenSSH has some
workarounds, but this quickly becomes ugly), you need to manage SSH keys,
both public and local, and protocol has plenty of options useful for
interactive administrative service, but terrible from security standpoint
(have you disabled everything unnecessary? and are you sure it was
everything?). If you use SSH in non-interactive, non-supervised mode, it is
a disaster waiting to happen.
> Why aren’t we using SSH for everything?
Because it is not suited for everything. It is only suited for providing
shell and for some non-interactive but human-supervised tasks.
> RPC API
Please don't. Managing SSH sensibly (with checking keys properly) in any greater scale is awful. SSH was never meant for general communication, which reflects how it operates on implementation level and on protocol level. SSH servers require usable home directory locally and remotely (OpenSSH has some workarounds, but this quickly becomes ugly), you need to manage SSH keys, both public and local, and protocol has plenty of options useful for interactive administrative service, but terrible from security standpoint (have you disabled everything unnecessary? and are you sure it was everything?). If you use SSH in non-interactive, non-supervised mode, it is a disaster waiting to happen.
> Why aren’t we using SSH for everything?
Because it is not suited for everything. It is only suited for providing shell and for some non-interactive but human-supervised tasks.