You are not logged in.

#1 2012-03-01 13:39:28

boina
Member
From: Barcelona - Spain
Registered: 2011-06-05
Posts: 46

Groups issue [SOLVED]

While trying to install a printer on my laptop somehow I manage to change the group all my files belong to.

[netlak@soulrebel ~]$ ls -l
total 4224
-rw-r--r--  1 netlak sys     142 nov 15 17:54 cho.csv~
-rw-r--r--  1 netlak sys 2130487 feb 20 17:44 Composite_deconv.tif
-rw-r--r--  1 netlak sys 2019706 oct  5 19:30 Composite.tif
-rw-r--r--  1 netlak sys      19 feb 24 14:09 dentista
drwx------  7 netlak sys   12288 feb 29 17:20 Descargas
drwxr-xr-x  2 netlak sys    4096 dic 24 11:37 Desktop
-rwxr-xr-x  1 netlak sys     284 feb 28 15:52 diow
-rwxr-xr-x  1 netlak sys     283 feb 28 15:49 diow~
drwx------  8 netlak sys    4096 feb 28 11:18 Documentos
drwx------  5 netlak sys    4096 mar  1 10:06 Dropbox
drwx------  6 netlak sys    4096 nov 15 17:17 Experimentos
drwx------  5 netlak sys    4096 feb 20 17:05 Imágenes
drwx------ 14 netlak sys    4096 feb 20 17:10 Labo
-rw-r--r--  1 netlak sys    6221 sep 15 16:57 lulu.csv~
drwx------ 78 netlak sys    4096 oct 23 20:58 Música

Where it says "sys" group it used to say "users" and I checked that on another pc where they all belong to the users group. I haven't noticed any strange behavior but I would like to know whether this is right or not and if so how to revert the changes.
Thanks in advanced, José.

Last edited by boina (2012-03-01 18:38:49)

Offline

#2 2012-03-01 13:54:00

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Groups issue [SOLVED]

# chgrp -R users /home/netlak

Should take care of that for you. Change "/home/netlak" to whatever directory is affected obviously.


Burninate!

Offline

#3 2012-03-01 14:19:34

boina
Member
From: Barcelona - Spain
Registered: 2011-06-05
Posts: 46

Re: Groups issue [SOLVED]

Great!! I did that and reverted the changes and is nice to see it back as it was,n although I don't understand what is the sys group or in any case the users group.
Thanks for your help, jose.

Offline

#4 2012-03-01 15:21:56

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Groups issue [SOLVED]

For some more info about the different groups; you can always take a look here.


Burninate!

Offline

#5 2012-03-01 16:51:40

boina
Member
From: Barcelona - Spain
Registered: 2011-06-05
Posts: 46

Re: Groups issue [SOLVED]

Thanks for your help!!

Offline

#6 2012-03-01 17:19:08

boina
Member
From: Barcelona - Spain
Registered: 2011-06-05
Posts: 46

Re: Groups issue [SOLVED]

I understand what the groups and solved the issue posted initially. The problem is that whenever I create a new file or directory the group shown is "sys" and not "users". How can I change this behavior??

Offline

#7 2012-03-01 17:35:22

KingX
Member
From: CA
Registered: 2010-03-24
Posts: 324

Re: Groups issue [SOLVED]

Can you post the output of this command

 cat /etc/passwd | grep netlak 

. Looks like somehow you changed the default group for your user to sys.

Offline

#8 2012-03-01 17:46:37

boina
Member
From: Barcelona - Spain
Registered: 2011-06-05
Posts: 46

Re: Groups issue [SOLVED]

Here is the output:

[netlak@soulrebel ~]$ cat /etc/passwd | grep netlak 
netlak:x:1000:3:José:/home/netlak:/bin/bash

Offline

#9 2012-03-01 17:57:50

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Groups issue [SOLVED]

boina wrote:

Here is the output:

[netlak@soulrebel ~]$ cat /etc/passwd | grep netlak 
netlak:x:1000:3:José:/home/netlak:/bin/bash

NB: this is a useless use of cat, it should be:

grep netlak /etc/passwd

Now, if you want to change your default group back to "users", do:

sudo usermod -g $(awk -F':' '/users/ {print $3}' /etc/group) $(whoami)

The awk statement seeks for lines containing "users" in the file "/etc/group" and prints out the third semicolon-delimited field. The effect of this is to return the gid of the users group.

Last edited by /dev/zero (2012-03-01 17:59:40)

Offline

#10 2012-03-01 18:37:56

boina
Member
From: Barcelona - Spain
Registered: 2011-06-05
Posts: 46

Re: Groups issue [SOLVED]

Well, finally I got it. It was a very simple solution:

usermod -g users netlak

Restart the session and listo!!
Thanks for your help!!

Last edited by boina (2012-03-01 18:38:30)

Offline

Board footer

Powered by FluxBB