How to log ssh debug info?

前端 未结 3 642
你的背包
你的背包 2021-02-01 02:15

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
         


        
相关标签:
3条回答
  • 2021-02-01 02:55
     -E log_file
             Append debug logs to log_file instead of standard error.
    
    0 讨论(0)
  • 2021-02-01 03:09

    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
    
    0 讨论(0)
  • 2021-02-01 03:13

    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
    
    0 讨论(0)
提交回复
热议问题