给定以下用户:
$ whoami
admin
$ groups
staff everyone admin groupA
和
$ whoami
user
$ groups
staff everyone groupB
我试图了解该--preserve-groups
选项的确切影响。
$ whoami
admin
$ sudo --preserve-groups -u user groups
staff everyone groupB
$ sudo --preserve-groups -u user -s groups
staff everyone groupB
$ sudo --preserve-groups -u user -i groups
staff everyone groupB
我阅读选项文档的方式我希望从执行的命令中看到的组列表来自调用用户而不是来自目标用户。但似乎并非如此。