IPv6 पते का उपयोग करके SSH कनेक्शन

Home PDF Audio

मैं Hetzner क्लाउड में एक मशीन से IPv6 के उपयोग से कनेक्ट करने की कोशिश कर रहा हूँ। ssh 2a01:4f8:c17:2000::/64 काम नहीं करता है, लेकिन ssh root@2a01:4f8:c17:2000::1 काम करता है।

IPv6 पता Hetzner क्लाउड कंसोल से कॉपी किया गया था।

IPv4 और IPv6 पतों के लिए अलग-अलग प्रॉक्सी नियम लागू करने के लिए ~/.ssh/config फ़ाइल को कॉन्फ़िगर किया जा सकता है। यह सेटअप आपको IPv4 पतों के लिए एक प्रॉक्सी कमांड निर्दिष्ट करने की अनुमति देता है जबकि IPv6 पतों को अलग तरह से संभालता है।

Host 192.168.1.*
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa 
Host *.*.*.*
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa
    ProxyCommand corkscrew localhost 7890 %h %p
Host *
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa   

ssh root@192.168.1.3 चलाने पर, निम्न आउटपुट दिखाता है कि SSH क्लाइंट ~/.ssh/config फ़ाइल से कॉन्फ़िगरेशन विकल्प लागू कर रहा है:

debug1: Reading configuration data /Users/lzwjava/.ssh/config
debug1: /Users/lzwjava/.ssh/config line 1: Applying options for 192.168.1.*
debug1: /Users/lzwjava/.ssh/config line 5: Applying options for *.*.*.*
debug2: add_identity_file: ignoring duplicate key ~/.ssh/id_rsa
debug1: /Users/lzwjava/.ssh/config line 10: Applying options for *
debug2: add_identity_file: ignoring duplicate key ~/.ssh/id_rsa
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname 192.168.1.3 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/lzwjava/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/lzwjava/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug3: channel_clear_timeouts: clearing
debug1: Executing proxy command: exec corkscrew localhost 7890 192.168.1.3 22

SSH कनेक्शन की गति काफी धीमी थी, इसलिए मैंने निम्न सरल कॉन्फ़िगरेशन में वापस आ गया:

Host 192.168.1.*
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa 
Host *
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa  
    ProxyCommand corkscrew localhost 7890 %h %p 

जब ProxyCommand corkscrew localhost 7890 %h %p निर्देश के साथ IPv6 पतों का उपयोग किया जाता है, तो समस्या उत्पन्न होती है, क्योंकि यह प्रॉक्सी कमांड IPv6 पतों को सही ढंग से संभाल नहीं सकता है।


Back 2025.02.22 Donate