No, you can't integrate a remote
sudo call into a
ProxyCommand in your use-case, but you can -since OpenSSH 7.6 (Oct 2018)- use:
Specifies a command to execute on the remote machine after successfully connecting to the server. The command string extends to the end of the line, and is executed with the user's shell. Arguments to
RemoteCommand accept the tokens described in the TOKENS section.
So, you can make an entry in
.ssh/config like so:
RemoteCommand sudo -u sshuser ssh final-host
... Other options for jumphost, if necessary
This works only for the terminal subsystem, therefore
sftp finalhost will land you on jumphost, not finalhost.
git and some other tools will not work with finalhost.