What is the difference between "id" and "id {my_own_username}"? And how do I add users to groups?
0
votes
1
answer
62
views
I have a situation where one user (
minknow
) is creating files/directories and I want another user (mine, nano2
) to have rwx
(full) access to them without having to sudo
change permissions every time a new directory is created.
So I have attempted to solve this problem by simply adding the primary group of the minknow
user as a secondary group to the nano2
user using the command below:
-sh
sudo usermod -a -G minknow nano2
This should add the group minknow
to the user nano2
.
I have then checked the groups by using the id -Gn
command to verify the addition of the group:
-shellsession
nano2@nano2:/var/lib/minknow/data/P2_WGS_v3/23RKG025670$ id -Gn nano2
nano2 adm cdrom sudo dip plugdev lpadmin sambashare minknow docker
But it does not work as intended. The nano2
user does not have permissions as part of the minknow
group - I have a directory created by the minknow user with the following permissions (ll
output):
drwxrwxr-x 3 minknow minknow 4096 Jan 8 10:46 23RKG025670/
The nano2
user is unable to create any files within that directory.
Now, I happened to also check the id
command without specifying the username. Per my understanding, this should simply output *my* ID and groups, but the output is slightly different from that above:
-shellsession
nano2@nano2:/var/lib/minknow/data/P2_WGS_v3/23RKG025670$ id -Gn
nano2 adm cdrom sudo dip plugdev lpadmin lxd sambashare
Two groups are missing, including the minknow
group.
I have verified that my user is in fact nano2
with the whoami
command.
What is going on here?
* What is the difference id
and id {my_own_username}
?
* And why does my attempt at granting groups permissions to nano2
fail?
Asked by Natalensis
(21 rep)
Jan 15, 2025, 01:39 PM
Last activity: Jan 24, 2025, 02:50 PM
Last activity: Jan 24, 2025, 02:50 PM