2013-03-26 6 views
5

मेरा एसएसएच अब केवल सार्वजनिक कुंजी प्रमाणीकरण स्वीकार करता है। भले ही मुझे यकीन है कि "पासवर्ड प्रमाणीकरण" मेरे/etc/ssh/ssh_config में हाँ है। यहां मेरा एसएसएच लॉग है। मैं जानना चाहता हूं कि मेरे एसएसएच में पासवर्ड प्रमाणीकरण क्यों नहीं है? पीएस: मैं कमांड लाइन में "-o PubkeyAuthentication = no" जोड़कर पासवर्ड प्रमाणीकरण का उपयोग करने के लिए एसएसएच को मजबूर कर सकता हूं।पासवर्ड प्रमाणीकरण क्यों अनुमति नहीं है?

[email protected]:~$ ssh -l lab 10.19.170.114 -v 
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012 
debug1: Reading configuration data /home/markz/.ssh/config 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 19: Applying options for * 
debug1: Connecting to 10.19.170.114 [10.19.170.114] port 22. 
debug1: Connection established. 
debug1: identity file /home/markz/.ssh/id_rsa type -1 
debug1: identity file /home/markz/.ssh/id_rsa-cert type -1 
debug1: identity file /home/markz/.ssh/id_dsa type -1 
debug1: identity file /home/markz/.ssh/id_dsa-cert type -1 
debug1: identity file /home/markz/.ssh/id_ecdsa type -1 
debug1: identity file /home/markz/.ssh/id_ecdsa-cert type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1 
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: kex: server->client aes128-ctr hmac-md5 none 
debug1: kex: client->server aes128-ctr hmac-md5 none 
debug1: sending SSH2_MSG_KEX_ECDH_INIT 
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY 
debug1: Server host key: ECDSA d5:c0:00:1b:bf:54:56:a0:c6:68:6f:62:a4:1a:e3:e1 
debug1: Host '10.19.170.114' is known and matches the ECDSA host key. 
debug1: Found key in /home/markz/.ssh/known_hosts:10 
debug1: ssh_ecdsa_verify: signature correct 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
debug1: Roaming not allowed by server 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug1: Authentications that can continue: publickey,password 
debug1: Next authentication method: publickey 
debug1: Offering RSA public key: [email protected] 
debug1: Authentications that can continue: publickey,password 
debug1: Offering RSA public key: [email protected] 
debug1: Authentications that can continue: publickey,password 
debug1: Offering RSA public key: [email protected] 
debug1: Authentications that can continue: publickey,password 
debug1: Offering RSA public key: [email protected] 
debug1: Authentications that can continue: publickey,password 
debug1: Offering RSA public key: [email protected] 
debug1: Authentications that can continue: publickey,password 
debug1: Offering RSA public key: [email protected] 
Received disconnect from 10.19.170.114: 2: Too many authentication failures for lab 

उत्तर

3

एसएसएच क्लाइंट में पासवर्ड प्रमाणीकरण का प्रयास करने में कोई बदलाव नहीं है क्योंकि सभी प्रमाणीकरण प्रयासों का उपयोग आपकी सार्वजनिक कुंजी के लिए किया जाता है।

हटाया अप्रयुक्त सार्वजनिक कुंजी, ~/.ssh/config की तरह

होस्ट * PubkeyAuthentication कुछ जोड़ना = नहीं

या वास्तव में सर्वर साइड पर ~/.ssh/authorized_keys को एक सार्वजनिक कुंजी जोड़कर सार्वजनिक कुंजी प्रमाणीकरण का उपयोग करें।

+0

धन्यवाद। हां, मेरे पास मेरी ~/.ssh निर्देशिका में कुछ सार्वजनिक कुंजी हैं, लेकिन मेरी समझ के अनुसार, ssh को id_rsa.pub को छोड़कर प्रमाणित करने का प्रयास करने के लिए उनका उपयोग नहीं करना चाहिए। लेकिन वैसे भी, मुझे लगता है कि आपका सुझाव सही है, मैं कोशिश करूँगा। –

+0

"होस्ट * PubkeyAuthentication = नहीं" जोड़कर, मैं सर्वर में लॉगिन कर सकता हूं जिसके लिए पासवर्ड प्रमाणीकरण की आवश्यकता होती है लेकिन सर्वर को लॉगिन नहीं कर सकता जिसके लिए पबकी की आवश्यकता होती है। :( –

+0

ठीक है, मैंने इसे समझ लिया। प्रत्येक साइट के लिए "पब्की प्रमाणीकरण हां" जोड़ने की आवश्यकता है जिसके लिए पब्की प्रमाणीकरण की आवश्यकता है। –

4

मुझे डर है कि आपके ~/.ssh में बहुत सी कुंजी उपलब्ध हैं।

ssh पहले उपलब्ध प्रत्येक कुंजी का उपयोग करने का प्रयास करने लगता है, लेकिन लक्ष्य मशीन केवल 5 प्रमाणीकरण अनुरोध स्वीकार करेगी, इसलिए पासवर्ड प्रमाणीकरण का प्रयास करने का कोई मौका नहीं है।

कुछ अप्रयुक्त कुंजी को ले जाएं या हटाएं ताकि आपके "ssh-add -l" में 5 से कम कुंजी हो।

1

मुझे यह भी पता चला कि यह त्रुटि तब पॉप अप हो जाती है जब आपके पास एक ही होस्ट नाम सेट नहीं होता है क्योंकि सर्वर खाता स्वयं ही होता है, भले ही आपका खाता मान्य है और ssh सार्वजनिक कुंजी की अनुमतियां सही तरीके से सेट की गई हैं।

तो उदाहरण के लिए आपने अपने/etc/hosts में मेजबाननाम को स्थानीय रूप से ओवरराइड कर दिया है, जो उपनाम देता है जो वास्तविक होस्टनाम दूरस्थ एसएसएच सर्वर का है।

XX.XX.YY.YY host.correct.domain hostalias 

आप, hostalias, दूरस्थ SSH सर्वर सार्वजनिक कुंजी प्रमाणीकरण मना कर दिया के रूप में होस्ट नाम का उपयोग कर ssh करने की कोशिश कर रहे हैं, तो है क्योंकि इसके होस्ट नाम host.correct.domain है। यह OpenSSH v4.3 सर्वर संस्करण पर होता है।

उम्मीद है कि इससे मदद मिलती है।

+0

ठीक है .. मेरी समस्या के बावजूद यह नहीं है, धन्यवाद। –

संबंधित मुद्दे