Rechercher

6.5. Overriding the LDAP shell attribute

download PDF

As an administrator, you can configure an existing host to use accounts from LDAP. However, the values for a user (name, UID, GID, home directory, shell) in LDAP are different from the values on the local system. You can override the LDAP shell attribute by defining a different shell with the following procedure.

Conditions préalables

  • root access
  • Installed sssd-tools

Procédure

  1. Display the current shell of the user:

    # getent passwd user-name
    user-name:x:XXXX:XXXX::/home/home-directory:/bin/bash

    Replace user-name with the name of the user.

  2. Override the shell of the user:

    # sss_override user-add user-name -s new-shell

    Replace user-name with the name of the user and replace new-shell with the new shell.

  3. Restart SSSD for the changes to take effect:

    # systemctl restart sssd

Verification steps

  • Verify that the new shell is defined:

    # getent passwd user-name
    user-name:x:XXXX:XXXX::/home/home-directory:new-shell
  • Optional. Display the overrides for the user:

    # sss_override user-show user-name
    user@ldap.example.com::::::new-shell:

    Exemple 6.5. Overriding the shell of the user

    To change the shell of the user sarah from /bin/bash to sbin/nologin:

    1. Display the current shell of the user sarah:

      # getent passwd sarah
      sarah:x:1001:6003::sarah:/bin/bash
    2. Override the shell of the user sarah with new /sbin/nologin shell:

      # sss_override user-add sarah -s /sbin/nologin
    3. Restart SSSD for the changes to take effect:

      # systemctl restart sssd
    4. Verify that the new shell is defined and overrides for the user display correctly:

      # getent passwd sarah
      sarah:x:1001:6003::sarah:/sbin/nologin
      
      # sss_override user-show user-name
      user@ldap.example.com::::::/sbin/nologin:

Ressources supplémentaires

  • sss_override man page
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.