Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299
Rep:
Quote:
Originally Posted by acid_kewpie
3. nothign offhand to spool all that out, but "id -a username" will list all the groups for one user.
This is what makes Linux so fascinating. A "Little gem of a command" like the above always seem to spring out of nowhere ! Thanks AK !!!! Its a lot more convenient than viewing the etc/group file.
cumhur@mfc-falter:~> id -a cumhur
uid=1010(cumhur) gid=100(users) groups=100(users),16(dialout),33(video)
cumhur@mfc-falter:~> whoami
cumhur
cumhur@mfc-falter:~> mkdir test
cumhur@mfc-falter:~> ls -l
total 44
drwx------ 5 cumhur users 12288 Dec 11 11:53 Desktop
drwx------ 2 cumhur users 4096 Aug 7 13:17 Documents
drwxr-xr-x 2 cumhur users 4096 Aug 7 13:17 bin
drwxr-xr-x 2 cumhur users 4096 Aug 7 13:17 public_html
drwxr-xr-x 2 cumhur users 4096 Dec 11 13:54 test
so there is a user named "cumhur", he belongs to groups users, dialout and video, and the files created by him will be created as default under the users group..is it right?
if yes, how can i modify it? i want to create another group with the same as the user "cumhur" and the user "cumhur" belongs only to this group..
another question, what does dialout and video groups mean/do..what happens if i remove user "cumhur" out of the groups?
not sure what you're actually asking... you want to create another user with the same name??
as for what the other groups are, dialout is presumably the group with permission to dial a modem link, and video? no idea to be honest... obviously some sort of ownership about video device access.. possibly for accelerated access like OpenGL?
not sure what you're actually asking... you want to create another user with the same name??
sorry for my chaotic english..i just want to create another group called "cumhur" (just as the user), place the user to this group and remove from the group "users".
First you need to create a "cumhur" group. Then you need to make this group the users default group. The second part can be done using the "usermod" command. Your distro may have a gui config program where you can manage groups and users if that is how you want to proceed.
See the manpages for groupadd, groupdel, groupmod, usemod, passwd and shadow.
If you want to edit the /etc/passwd or /etc/group files directly, you should use "vipw" or "vigr" respectively. This will add error correction. You will also be using the "vim" program. However, using usermod, etal would be better because some changes need to be reflected also in /etc/shadow.
The OP hasn't learned anything about these utilities yet and will probably torch up his system editing /etc/passwd directly.
However, I did direct him to the manpages for passwd and shadow.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.