Ar PermitRootLogin remiasi UID arba vartotojo vardu?

Turinys:

Ar PermitRootLogin remiasi UID arba vartotojo vardu?
Ar PermitRootLogin remiasi UID arba vartotojo vardu?

Video: Ar PermitRootLogin remiasi UID arba vartotojo vardu?

Video: Ar PermitRootLogin remiasi UID arba vartotojo vardu?
Video: iOS 16 - Top 10 Coolest Features! - YouTube 2024, Gegužė
Anonim
Kartais įdomu kaskart gilinti į tai, kaip viskas veikia, norint patenkinti jūsų smalsumą, kai mokosi ką nors naujo, pavyzdžiui, PermitRootLogin. Ar jis patikrina UID arba vartotojo vardą? Šiandienos "SuperUser Q &A" įrašas renkasi, kad surastų atsakymą į įdomų skaitytojo klausimą.
Kartais įdomu kaskart gilinti į tai, kaip viskas veikia, norint patenkinti jūsų smalsumą, kai mokosi ką nors naujo, pavyzdžiui, PermitRootLogin. Ar jis patikrina UID arba vartotojo vardą? Šiandienos "SuperUser Q &A" įrašas renkasi, kad surastų atsakymą į įdomų skaitytojo klausimą.

Šiandieninė klausimų ir atsakymų sesija pateikiama su "SuperUser" - "Stack Exchange", bendruomenės valdoma Q & A grupių asociacija.

Klausimas

SuperUser skaitytuvas ge0rg nori žinoti, ar PermitRootLogin yra pagrįstas UID arba vartotojo vardu:

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?

Ar PermitRootLogin pagrįstas UID arba vartotojo vardu?

Atsakymas

"SuperUser" autorius Mtak atsakė mums:

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

Ar turite ką nors įtraukti į paaiškinimą? Garsas išjungtas komentaruose. Norite skaityti daugiau atsakymų iš kitų "Tech-savvy Stack Exchange" vartotojų? Patikrinkite visą diskusijų temą čia.

Vaizdo kreditas: "Linux" ekrano nuotraukos / "Xmodulo" ("Flickr" / "Xmodulo")

Rekomenduojamas: