我想知道默认情况下简单(非管理员)用户属于哪些组。
然后我将编写如下用户组成员脚本:
for group in $simpleUserGroups
do
groups $userName | grep -q $group || $sudo adduser $userName $group
done
kcmshell5 user_manager
因此,在填写字段(名称、密码等...)后,我进入了 KUbuntu 20.04.3 LTS 的 GUI,在那里管理用户( ),当我单击时Apply
什么也没有发生(系统应该打开一个弹出窗口提示输入管理员密码):请参阅启动板错误 #1883357。
当我检查用户是否已创建时,我得到:
$ id testUser
id: ‘testUser’: no such user
EDIT0:您可以通过执行以下操作每次重现此错误:
$ ssh -X remote-PC
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-89-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
68 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
Web console: https://seb-x-y-z:9090/ or https://192.168.x.Y:9090/
Last login: Sun Nov 7 16:10:48 2021 from 127.0.0.1
.cache -> /tmp/sebastien/.cache/
dim. 07 nov. 2021 16:12:19 CET
$ kcmshell5 user_manager
Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use:
QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-screen factors.
QT_SCREEN_SCALE_FACTORS to set per-screen factors.
QT_SCALE_FACTOR to set the application global scale factor.
Couldn't load plugin: "The shared library was not found."
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1938, resource id: 32072962, major code: 40 (TranslateCoords), minor code: 0
然后单击“应用”,您会注意到 sudo 密码窗口没有弹出。
KUbuntu 上非管理员用户默认属于哪些组?
答案1
我刚刚通过名为 的 GUI 创建了一个名为“标准”的用户fips
。让我们看看该用户fips
能提供什么:
mook@computer:~$ su fips
Password:
fips@computer:/home/mook$ id
uid=1001(fips) gid=1001(fips) groups=1001(fips)
fips@computer:/home/mook$ cd ~
fips@computer:~$ ls -al
total 68
drwxr-x--- 4 fips fips 4096 Nov 7 00:03 .
drwxr-xr-x 6 root root 4096 Nov 7 00:05 ..
-rw------- 1 fips fips 57 Nov 7 00:03 .bash_history
-rw-r--r-- 1 fips fips 220 Nov 6 23:53 .bash_logout
-rw-r--r-- 1 fips fips 3771 Nov 6 23:53 .bashrc
drwxr-xr-x 3 fips fips 4096 Nov 6 23:53 .config
-rw-r--r-- 1 fips fips 14720 Nov 6 23:53 .face
-rw-r--r-- 1 fips fips 14720 Nov 6 23:53 .face.icon
-rw-r--r-- 1 fips fips 274 Nov 6 23:53 .gtkrc-2.0
drwxr-xr-x 3 fips fips 4096 Nov 6 23:53 .local
-rw-r--r-- 1 fips fips 807 Nov 6 23:53 .profile
等效的 cli 命令是
sudo adduser fips
默认情况下不添加其他组。