क्या UID या उपयोगकर्ता नाम के आधार पर PermitRootLogin है?

विषयसूची:

क्या UID या उपयोगकर्ता नाम के आधार पर PermitRootLogin है?
क्या UID या उपयोगकर्ता नाम के आधार पर PermitRootLogin है?

वीडियो: क्या UID या उपयोगकर्ता नाम के आधार पर PermitRootLogin है?

वीडियो: क्या UID या उपयोगकर्ता नाम के आधार पर PermitRootLogin है?
वीडियो: The Best New Features in iOS 10 - YouTube 2024, मई
Anonim
कभी-कभी यह कुछ गहराई से खोदना मजेदार होता है कि कुछ नया सीखते समय चीजें आपकी जिज्ञासा को पूरा करने के लिए कैसे काम करती हैं, उदाहरण के लिए परमिट रूट लोगिन। क्या यह यूआईडी या उपयोगकर्ता नाम की जांच करता है? आज के सुपर यूज़र क्यू एंड ए पोस्ट एक जिज्ञासु पाठक के सवाल का जवाब खोजने के लिए खोदता है।
कभी-कभी यह कुछ गहराई से खोदना मजेदार होता है कि कुछ नया सीखते समय चीजें आपकी जिज्ञासा को पूरा करने के लिए कैसे काम करती हैं, उदाहरण के लिए परमिट रूट लोगिन। क्या यह यूआईडी या उपयोगकर्ता नाम की जांच करता है? आज के सुपर यूज़र क्यू एंड ए पोस्ट एक जिज्ञासु पाठक के सवाल का जवाब खोजने के लिए खोदता है।

आज का प्रश्न और उत्तर सत्र हमारे पास सुपरयूसर की सौजन्य है - स्टैक एक्सचेंज का एक उपविभाग, क्यू एंड ए वेब साइट्स का एक समुदाय संचालित समूह।

प्रश्न

सुपरयूसर रीडर ge0rg जानना चाहता है कि PermitRootLogin यूआईडी या उपयोगकर्ता नाम पर आधारित है या नहीं:

The man page states that PermitRootLogin:

Specifies whether root can log in using ssh(1).

However, it is not clear if this check is based on the user name (root) or the UID (0). What happens if the root account is renamed to admin? Will admin be able to log in when PermitRootLogin=no? What happens if there are two accounts with UID=0 (i.e. root and admin)? Will either of them be able to log in?

क्या UID या उपयोगकर्ता नाम के आधार पर PermitRootLogin है?

उत्तर

SuperUser योगदानकर्ता mtak हमारे लिए जवाब है:

It seems the check is done with the UID (tested on OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016):

Set PermitRootLogin to Off:

Image
Image

Make sure a user named admin is created with UID 0:

Make sure the user can be used to log in to the system:
Make sure the user can be used to log in to the system:
Check to see if we can log in to the system using SSH:
Check to see if we can log in to the system using SSH:
Image
Image

If we set PermitRootLogin back to On:

And try to log in:
And try to log in:
Image
Image

स्पष्टीकरण में जोड़ने के लिए कुछ है? टिप्पणियों में विचार व्यक्त करो। अन्य तकनीक-समझदार स्टैक एक्सचेंज उपयोगकर्ताओं से अधिक उत्तरों पढ़ना चाहते हैं? यहां पूर्ण चर्चा धागा देखें।

छवि क्रेडिट: लिनक्स स्क्रीनशॉट / एक्समोडुलो (फ़्लिकर / एक्समोडुलो)

सिफारिश की: