Shell
cat /etc/login.defs
...
# List of groups to add to the user's supplementary group set
# when logging in on the console (as determined by the CONSOLE
# setting). Default is none.
#
# Use with caution - it is possible for users to gain permanent
# access to these groups, even when not logged in on the console.
# How to do it is left as an exercise for the reader...
#
# This variable is used by login and su.
#
CONSOLE_GROUPS floppy:audio:cdrom:bar
Shell
user@debian:~$ cat /etc/group | egrep "floppy|audio|cdrom|bar"
cdrom:x:24:user
floppy:x:25:user
audio:x:29:pulse,user
bar:x:1007:
user@debian:~$
Shell
user@debian:~$ sudo useradd foo
user@debian:~$ sudo passwd foo
Введите новый пароль UNIX:
Повторите ввод нового пароля UNIX:
passwd: пароль успешно обновлён
user@debian:~$ sudo reboot
Shell
user@debian:~$ cat /etc/passwd | grep foo
foo:x:1006:1006::/home/foo:/bin/sh
user@debian:~$
Может, так?
Shell
user@debian:~$ cat /etc/group | egrep "floppy|audio|cdrom|bar"
cdrom:x:24:user
floppy:x:25:user
audio:x:29:pulse,user
bar:x:1007:
user@debian:~$
Выше (в cat /etc/login.defs) говорено было про какое login и su:
This variable is used by login and su
Shell
user@debian:~$ su foo
Пароль:
$ groups
foo
$ exit
user@debian:~$
Грустно это всё. Если входить в виртуальную консоль (tty1), тот же самый результат.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Может, косвенно как-нибудь проверить?
Создадим файл содержания cafebabe
Shell
user@debian:~$ echo cafebabe > /tmp/file
user@debian:~$
Изменим группу файла
Shell
user@debian:~$ sudo chown :bar /tmp/file
user@debian:~$
Права сделаем
Shell
user@debian:~$ chmod 640 /tmp/file
user@debian:~$
Смотрим на файл /tmp/file. Этот файл может прочесть либо владелец (user), либо член группы bar
Shell
user@debian:~$ sudo ls -l /tmp/file
-rw-r----- 1 user bar 9 Дек 20 23:45 /tmp/file
Shell
user@debian:~$ su foo
Пароль:
$ cat /tmp/file
cat: /tmp/file: Отказано в доступе
$
Нет, не является пользовтель foo членом группы bar. Грустно это всё. ЧЯДНТ? Спасибо, кто откликнется. Debian 7