You are not logged in.
When I open gnome-terminal, I find that my user only belong to one group. However it belongs to 3 groups as the command "cat /etc/group" shows. I have to run "su ${user}" to gain the proliviege of the rest groups. e.g. I cant run docker commands if I don't run "su ${user}".
In gnome-terminal:
➜ ~ whoami
tkit
➜ ~ cat /etc/group | grep tkit
wheel:x:998:tkit
rtkit:x:133:
docker:x:973:tkit
➜ ~ groups
root
➜ ~ su tkit
密码:
➜ ~ groups
root docker wheel
➜ ~ gnome-terminal --version
# GNOME Terminal 3.32.2 using VTE 0.56.3 +GNUTLSIn xterm all the groups are shown properly without runing "su ${user}".
I've seen a similar problem in stackoverflow https://superuser.com/questions/1348196 … -one-group, but he seems to using kde, and when he switch to gdm his problem disappers.
I am using gdm by default
➜ ~ pacman -Q gnome-terminal gdm
gnome-terminal 3.32.2-1
gdm-plymouth 3.32.0+2+g820f90f5-1How can I get gnome-terminal to work properly? Can anyone kind tell me?
Last edited by tkit (2019-07-09 09:53:07)
Offline
id -u
id -ru
id -G
id -rG
type id
type groupsOffline
➜ ~ id -u
1000
➜ ~ id -ru
1000
➜ ~ id -G
0 973 998
➜ ~ id -rG
0 973 998
➜ ~ type id
id is /usr/bin/id
➜ ~ type groups
groups is /usr/bin/groups
➜ ~ su tkit
密码:
➜ ~ id -u
1000
➜ ~ id -ru
1000
➜ ~ id -G
0 973 998
➜ ~ id -rG
0 973 998
➜ ~ type id
id is /usr/bin/id
➜ ~ type groups
groups is /usr/bin/groupsOffline
How did you install Arch?
Offline
How did you install Arch?
I followed the instruction on the wiki page. That's about 1 or 2 years ago, i cannot remember it exactly. Untill recently, I need to use docker and I found the question about groups.
I tried other terminals, xterm Deepin, Terminal and QTerminal work fine but Tilix works the same as gnome-terminal.
The work around is to use other terminal or run su ${user}, before running docker command to gain the privilege.
Offline
I added a new account and login to it and the the new account works properly. So i deleted my old account , add a new account with the same username and change the ownership of the old home directory. Gnome terminal works properly now. I dont know why this happens.
Offline
Why was your old user part of the root group and is your new user as well? Is it in the users group?
useradd --defaultshttps://wiki.archlinux.org/index.php/Us … Group_list
Why the "/usr/bin/groups" results would differ from the "/usr/bin/id" ones **and only in certain VTEs** (seems vte3) is beyond me (doesn't seem to be a shell/alias issue since "type" is clean), but I'd expect the group list to differ?
Offline
Anser to your question:
1. I add it to the root group mannually.
2. My new user is in the root group too.
3. Neither of them are in the user group
The default option for useradd:
➜ ~ useradd -D
密码:
GROUP=985
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=noThis this the information about my new user.
➜ ~ id -u
1002
➜ ~ id -ru
1002
➜ ~ id -G
1002 0 973 998
➜ ~ id -rG
1002 0 973 998
➜ ~ type id
id is /usr/bin/id
➜ ~ type groups
groups is /usr/bin/groups
➜ ~ groups
root docker wheel tkitand this is the command i used
userdel tkit
user add -m tkit
gpasswd -a tkit docker
gpasswd -a tkit root
gpasswd -a tkit wheel
chown -R tkit:tkit /home/tkit There was a warning about the home directory because it already exits. After changing the owner, the new account works properly. I changed my shell to zsh using chsh later. Both the new and the old account uses zsh.
It seems that useradd will not add a new accout to the user group by default. If i do not add a new user to the user group, what will happen? The wiki says it is Standard users group, but I haven't seen any influence.
Offline
GROUP=985grep 985 /etc/group
grep users /etc/groupBeing in the users group will allow you access to several system files which are not world readable/executable ("640") - you typically want your user to be in that group.
Otoh, i'd be very reluctant to add myself to the root group - wheel should entirely suffice.
The useradd behavior is defined by /etc/login.defs and /etc/default/useradd
pacman -Qo /etc/login.defs /etc/default/useradd
pacman -Qikk shadow # since shadow is supposed to provide both filesStill doesn't explain the wacko vte3 behavior - difference right now is that you've a user group and are added to it.
Offline
➜ ~ grep 985 /etc/group
users:x:985:
➜ ~ grep users /etc/group
users:x:985:
vboxusers:x:108:➜ ~ LANG=en_US.UTF-8
➜ ~ pacman -Qo /etc/login.defs /etc/default/useradd
/etc/login.defs is owned by shadow 4.6-3
/etc/default/useradd is owned by shadow 4.6-3
➜ ~ pacman -Qikk shadow # since shadow is supposed to provide both files
Name : shadow
Version : 4.6-3
Description : Password and account management tool suite with support for
shadow files and PAM
Architecture : x86_64
URL : https://github.com/shadow-maint/shadow
Licenses : BSD
Groups : base
Provides : None
Depends On : bash pam acl audit libaudit.so=1-64
Optional Deps : None
Required By : git redis util-linux
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 4.30 MiB
Packager : Levente Polyak <anthraxx@archlinux.org>
Build Date : 2019年04月04日 星期四 04时33分12秒
Install Date : 2019年05月24日 星期五 10时02分55秒
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature
shadow: 558 total files, 0 altered files
➜ ~ It seems the 985 is the id of the group for users, but my account is not in the group
➜ ~ cat /etc/default/useradd
# useradd defaults file for ArchLinux
# original changes by TomK
GROUP=users
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=no
➜ ~ cat /etc/login.defs | grep "^[^#]"
FAIL_DELAY 3
LOG_UNKFAIL_ENAB no
LOG_OK_LOGINS no
SYSLOG_SU_ENAB yes
SYSLOG_SG_ENAB yes
CONSOLE /etc/securetty
SU_NAME su
MAIL_DIR /var/spool/mail
HUSHLOGIN_FILE .hushlogin
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/bin
ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/bin
TTYGROUP tty
TTYPERM 0600
ERASECHAR 0177
KILLCHAR 025
UMASK 077
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_WARN_AGE 7
UID_MIN 1000
UID_MAX 60000
SYS_UID_MIN 500
SYS_UID_MAX 999
GID_MIN 1000
GID_MAX 60000
SYS_GID_MIN 500
SYS_GID_MAX 999
LOGIN_RETRIES 5
LOGIN_TIMEOUT 60
CHFN_RESTRICT rwh
DEFAULT_HOME yes
USERGROUPS_ENAB yes
MOTD_FILE
ENCRYPT_METHOD SHA512➜ ~ type useradd
useradd is /usr/bin/useraddLast edited by tkit (2019-07-09 08:01:20)
Offline
I found the cause.
The main group of the user was root.
I create a new user with root as main group and gnome terminal behaves abnornally just like my old user.
Here is the new user bgpe for testing.
➜ ~ id -Gn bgpe
root docker
➜ ~
➜ ~ id -gn bgpe
rootLast edited by tkit (2019-07-09 09:53:43)
Offline