TMAegisБета
Више правила за linux

Linux distributions

TMA-ROCKY9-7.2.6

Ensure no duplicate user names exist

СредњаНиво 1Аутоматскаlinux

Опис

Although the useradd program will not let you create a duplicate user name, it is possible for an administrator to manually edit the /etc/passwd file and change the username.

Како се проверава

Метод провере: Команда љуске

shell
alt0() { o=$(bash -c '#!/usr/bin/env bash

{
   while read -r l_count l_user; do
      if [ "$l_count" -gt 1 ]; then
         echo -e "Duplicate User: \"$l_user\" Users: \"$(awk -F: '"'"'($1 == n) { print $1 }'"'"' n=$l_user /etc/passwd | xargs)\""
      fi
   done < <(cut -f1 -d":" /etc/passwd | sort -n | uniq -c)
}' 2>&1); [ -z "$o" ] || { echo "step1: $o" | head -c 300; return 1; }; }; if alt0; then echo compliant; fi
Очекивани излаз
compliant

Како се исправља

Метод исправке: Смерница или закрпа инфраструктуре

Based on the Audit Procedure output, for each duplicated user name, determine which entry is correct and make each user name unique. Use vipw to safely edit the user database and either remove the redundant entry or rename it to a unique user name: # vipw File ownerships will reflect the change automatically as long as each account has a unique UID.

Својства

Оперативни системи
rocky-9
Ознаке
cis-convertedlinux
Референца
CIS Rocky Linux 9 Benchmark v3.0.0 - 7.2.6

Проверите овај рачунар

Покрените ово на рачунару за који имате дозволу за проверу. Скенирање ради у режиму само за читање.

shell
tmaegis scan --target linux