Onko PermitRootLogin UID: n tai käyttäjänimen perusteella?

Sisällysluettelo:

Onko PermitRootLogin UID: n tai käyttäjänimen perusteella?
Onko PermitRootLogin UID: n tai käyttäjänimen perusteella?

Video: Onko PermitRootLogin UID: n tai käyttäjänimen perusteella?

Video: Onko PermitRootLogin UID: n tai käyttäjänimen perusteella?
Video: Mitä mummin ja vaarin tulee tietää tietoturvasta? - YouTube 2024, Saattaa
Anonim
Joskus on hauskaa kaivaa hieman syvemmälle, miten asiat toimivat vain tyydyttämään uteliaisuutesi oppimalla jotain uutta, kuten esimerkiksi PermitRootLogin. Tarkistaako UID: n tai käyttäjänimen? Tämän päivän SuperUser Q & A -viesti kaivaa löytääkseen vastauksen utelias lukijan kysymykseen.
Joskus on hauskaa kaivaa hieman syvemmälle, miten asiat toimivat vain tyydyttämään uteliaisuutesi oppimalla jotain uutta, kuten esimerkiksi PermitRootLogin. Tarkistaako UID: n tai käyttäjänimen? Tämän päivän SuperUser Q & A -viesti kaivaa löytääkseen vastauksen utelias lukijan kysymykseen.

Tämän päivän kysymys- ja vastausistunto tulee meihin SuperUserin hyväksi - Stack Exchangein alaosasto, joka on yhteisöllinen Q & A-sivustojen ryhmittely.

Kysymys

SuperUser-lukija ge0rg haluaa tietää, onko PermitRootLogin perustunut UID: hen tai käyttäjänimiin:

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?

Onko PermitRootLogin UID: n tai käyttäjänimen perusteella?

Vastaus

SuperUser-avustaja mtakilla on vastaus meille:

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

Onko jokin asia lisättävä selitykseen? Kuulkaa kommentit. Haluatko lukea lisää vastauksia muilta tech-tajuilta Stack Exchange-käyttäjiltä? Katso koko keskusteluketju täältä.

Image Credit: Linux-kuvakaappaukset / Xmodulo (Flickr / Xmodulo)

Suositeltava: