Whitelisting the sshd allowed addresses can work by adding a special internal IP that uses Tor's mapadddress to refer to some onion address generated for SSH access later on.
https://www.golinuxcloud.com/restrict-allow-ssh-certain-users-groups-rhel/