I need to write the output of ssh debug info into the file. This
ssh -v root@172.16.248.xx > result.txt
ssh -v root@172.16.248.xx 2>&1 > result.txt
-E log_file
Append debug logs to log_file instead of standard error.
You have to change the order of the redirections on the command line:
ssh -v root@172.16.248.xx >result.txt 2>&1
or just:
ssh -v root@172.16.248.xx 2>result.txt
Apparently the best way to save this "hidden" debug output to the file is by using logsave:
logsave result.txt ssh -v root@172.16.248.xx