But otherwise, yes, you can run any valid command or pipeline on the server side so rm -rf is certainly acceptable.
AuthorizedKeysCommandUser root
I was just talking about standard ssh behavior.
I wouldn’t use that without seriously studying it end to end. As another comment said, “seems kind of hacky”.
But otherwise, yes, you can run any valid command or pipeline on the server side so rm -rf is certainly acceptable.