SSH, SCP ConnectionTimeout

来源:互联网 发布:阿里大数据竞赛 编辑:程序博客网 时间:2024/05/16 15:06

1, man ssh

-o option
             Can be used to give options in the format used in the configuration file.  This is useful for specifying
             options for which there is no separate command-line flag.  For full details of the options listed below, and
             their possible values, see ssh_config(5).


                   AddressFamily
                   BatchMode
                   BindAddress
                   ChallengeResponseAuthentication
                   CheckHostIP
                   Cipher
                   Ciphers
                   ClearAllForwardings
                   Compression
                   CompressionLevel
                   ConnectionAttempts
                   ConnectTimeout
                   ControlMaster
                   ControlPath
                   DynamicForward

2, man scp

-o ssh_option
             Can be used to pass options to ssh in the format used in ssh_config(5).  This is useful for specifying options
             for which there is no separate scp command-line flag.  For full details of the options listed below, and their
             possible values, see ssh_config(5).


                   AddressFamily
                   BatchMode
                   BindAddress
                   ChallengeResponseAuthentication
                   CheckHostIP
                   Cipher
                   Ciphers
                   Compression
                   CompressionLevel
                   ConnectionAttempts
                   ConnectTimeout
                   ControlMaster


e.g


ssh -o "ConnectionTimeout 10" user@192.168.0.3

The order will give up the connection when it can't receive the response signal in 10 seconds.