Is SSH remote execution more secure as local non-root?

Is there a security benefit running a command remotely via ssh as a local non-root user? In other words, is this actually more dangerous compared to executing the ssh command as non-root:

root@local:~# ssh user@remote "compromised_executable"

I'm assuming the local system isn't compromised and ssh doesn't have any security issues.


No, SSH does not add any benefit. It only ensures that the connection to the remote machine is encrypted, nothing more.

The non-root account should of course not have any sudo-permissions whether it is local or remote doesn't matter.

If you want added security, then execute the binary in a chroot environment or a container, or a VM you can throw away afterwards.