scp, rsync를 할때 connect 타임아웃을 주는 방법입니다.

서버가 응답을 하지 않을 때, 지정 시간 후에 종료하게 됩니다.

 

scp

# scp -o ConnectTimeout=10 ....

 

-o 을 주고 ssh 에서 사용되는 옵션들을 사용할 수 있습니다.
아래와 같은 옵션들이 있습니다. 그 중에서 ConnectTimeout 를 사용했습니다.

 

더보기

                   AddressFamily
                   BatchMode
                   BindAddress
                   CanonicalDomains
                   CanonicalizeFallbackLocal
                   CanonicalizeHostname
                   CanonicalizeMaxDots
                   CanonicalizePermittedCNAMEs
                   ChallengeResponseAuthentication
                   CheckHostIP
                   Cipher
                   Ciphers
                   Compression
                   CompressionLevel
                   ConnectionAttempts
                   ConnectTimeout
                   ControlMaster
                   ControlPath
                   ControlPersist
                   GlobalKnownHostsFile
                   GSSAPIAuthentication
                   GSSAPIDelegateCredentials
                   HashKnownHosts
                   Host
                   HostbasedAuthentication
                   HostKeyAlgorithms
                   HostKeyAlias
                   HostName
                   IdentityFile
                   IdentitiesOnly
                   IPQoS
                   KbdInteractiveAuthentication
                   KbdInteractiveDevices
                   KexAlgorithms
                   LogLevel
                   MACs
                   NoHostAuthenticationForLocalhost
                   NumberOfPasswordPrompts
                   PasswordAuthentication
                   PKCS11Provider
                   Port
                   PreferredAuthentications
                   Protocol
                   ProxyCommand
                   PubkeyAuthentication
                   RekeyLimit
                   RhostsRSAAuthentication
                   RSAAuthentication
                   SendEnv
                   ServerAliveInterval
                   ServerAliveCountMax
                   StrictHostKeyChecking
                   TCPKeepAlive
                   UsePrivilegedPort
                   User
                   UserKnownHostsFile
                   VerifyHostKeyDNS

 

rsync

# rsync -avzP -e 'ssh -o ConnectTimeout=10'  ....

 

rsync 도 ssh 옵션을 사용해서 타임아웃을 주었습니다.

 

728x90
반응형

+ Recent posts