La séance de questions et réponses d’aujourd’hui nous est offerte par SuperUser, une sous-division de Stack Exchange, un groupe de sites Web de questions-réponses dirigé par la communauté.
La question
Le lecteur superutilisateur ge0rg veut savoir si PermitRootLogin est basé sur l'UID ou le nom d'utilisateur:
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?
PermitRootLogin est-il basé sur l'UID ou le nom d'utilisateur?
La réponse
Le contributeur SuperUser mtak a la réponse pour nous:
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:
Make sure a user named admin is created with UID 0:
If we set PermitRootLogin back to On:
Avez-vous quelque chose à ajouter à l'explication? Sound off dans les commentaires. Voulez-vous lire plus de réponses d'autres utilisateurs de Stack Exchange doués en technologie? Découvrez le fil de discussion complet ici.
Crédit d'image: Captures d'écran Linux / Xmodulo (Flickr / Xmodulo)