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
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