It happens that the command you're running under
nohup never writes to stdout or stderr, and that you aren't sending any input to it. But
nohup has no way to know that, so it tells you that any input would be discarded and any output would be written to
To avoid this, redirect
nohup's stdin, stdout and stderr to
ssh -t esolve@hostname 'sudo nohup bash -c "ls > log 2>&1 &" </dev/null >/dev/null 2>/dev/null'
|&, from the bash manual:
The format for a pipeline is
[time [-p]] [!] command1 [ [| or |&] command2 …]
The output of each command in the pipeline is connected via a pipe to the input of the next command. That is, each command reads the previous command’s output. This connection is performed before any redirections specified by the command.
|& is used, the standard error of
command1 is connected to
command2’s standard input through the pipe; it is shorthand for
This is a bash extension, also present in zsh.