![]() | Red Hat Certified System Administration 8 |
Chapter 20: Configuring SSHGoalTo configure secure command-line access on remote systems using Open SSH.Sommaire
Accessing remote promptSSH host keysConfiguring SSH Key-based AuthenticationConfiguring SSH Key-based AuthenticationLes utilisateurs peuvent authentifier les connexions SSH sans mot de passe en utilisant l'authentification par clé publique. Ssh permet aux utilisateurs de s'authentifier à l'aide d'un schéma de clé public-privé. Cela signifie que deux clés sont générées, une clé privée et une clé publique. Le fichier de clé privée est utilisé comme authentification, informations d'identification, et comme un mot de passe, doit être gardé secret et sécurisé. La clé publique est copiée dans les systèmes sur lesquels l'utilisateur veut se connecter, et est utilisé pour vérifier la clé privée. La clé publique n'a pas besoin d'être secrète. Un serveur SSH disposant de la clé publique peut lancer un défi qui ne peut être géré que par un système contenant votre clé privée. Par conséquent, vous pouvez vous authentifier en utilisant la présence de votre clé. Cela vous permet d'accéder aux systèmes d'une manière qui ne nécessite pas de taper un mot de passe à chaque fois, mais qui reste sécurisée.
Customizing SSH Service ConfigurationCustomizing SSH Service ConfigurationThe OpenSSH server configuration fileWhile Open SSH server configuration usually does not require modification, additional security measures are available. Various aspects of the Open SSH server can be modified in the configuration file /etc/ssh/sshd_config. Prohibit the root user from logging in using SSHFrom a security stand point. It is advisable to prohibit the root user from directly logging in to the system with ssh.The user name root exists on every Linux system by default, so a potential attacker only has to guess the password, instead of a valid username and password combination. The root user has unrestricted privileges. PermitRootLogin no Prohibit password authentication using SSHOnly allowing key-based logins to the remote command line has various advantages:
PasswordAuthentication no /etc/ssh/sshd_config# CommentsPasswordAuthentication yes-or-no # yes to permit user password authenfitication, no to deny user password authenfitication, authorize only key-based Authentication PermitRootLogin yes-or-no # yes to permit login with root account, no to deny login with root account MaxSessions n # used to tune the maximum number of sessions that can be open at the same time. Default value is 10 |