Vai PermitRootLogin pamatojas uz UID vai lietotāja vārdu?

Satura rādītājs:

Vai PermitRootLogin pamatojas uz UID vai lietotāja vārdu?
Vai PermitRootLogin pamatojas uz UID vai lietotāja vārdu?

Video: Vai PermitRootLogin pamatojas uz UID vai lietotāja vārdu?

Video: Vai PermitRootLogin pamatojas uz UID vai lietotāja vārdu?
Video: The Best New Features in iOS 10 - YouTube 2024, Aprīlis
Anonim
Dažreiz ir jautri, piemēram, PermitRootLogin, kaut kas dziļāk izrakt, kā kaut kas darbojas, lai apmierinātu jūsu interesi. Vai tas pārbauda UID vai lietotāja vārdu? Šodienas SuperUser Q & A ziņa rakt, lai atrastu atbildi uz ziņkārīgs lasītāja jautājumu.
Dažreiz ir jautri, piemēram, PermitRootLogin, kaut kas dziļāk izrakt, kā kaut kas darbojas, lai apmierinātu jūsu interesi. Vai tas pārbauda UID vai lietotāja vārdu? Šodienas SuperUser Q & A ziņa rakt, lai atrastu atbildi uz ziņkārīgs lasītāja jautājumu.

Šodienas jautājumu un atbilžu sesija mums priecājas par SuperUser - Stack Exchange dalību, kas ir kopienas vadīta Q & A tīmekļa vietņu grupa.

Jautājums

SuperUser lasītājs ge0rg vēlas uzzināt, vai PermitRootLogin ir balstīts uz UID vai lietotāja vārdu:

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?

Vai PermitRootLogin ir balstīts uz UID vai lietotāja vārdu?

Atbilde

SuperUser atbalstītājs mtak ir atbilde 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

Vai kaut ko pievienot paskaidrojumam? Skatieties komentāros. Vēlaties lasīt citas atbildes no citiem tehnoloģiju savvy Stack Exchange lietotājiem? Šeit skatiet pilnu diskusiju pavedienu.

Attēlu kredīts: Linux ekrānuzņēmumi / Xmodulo (Flickr / Xmodulo)

Ieteicams: