LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Changing GID in X (https://www.linuxquestions.org/questions/linux-software-2/changing-gid-in-x-160890/)

dxdad 03-22-2004 07:21 AM

Changing GID in X
 
Suppose my username is "paul" and I am in, by default, group "users". But i'm also in group "test". I'd like to edit a file with permissions : rw-rw-r-- and the file is owned by test:test

I'm unable to edit the file (I can read it but not write to it) unless I switch to group "test". On a console I can do: "sg test" and I will be able to edit it. But how can I do that in X? If I want to use kate to edit it can I only do this by starting konsol (or similar) and "sg"ing and then starting kate from there? Or is there and easier way? I can't help but feel this is the thing that lets down linux. In windows you can set as many users as you like to be able to access a file, but in linux only one user, one group and "everyone else".

Any help would be much appriciated.

andrewlkho 03-22-2004 08:13 AM

Despite the fact that I can't come up with a quick way to do what you want, I still find chmod and chown far more intuitive (especially when combined with an 'ls -l') than the windows way of doing file permissions, which hides it in an incredibly obscure way.

Although the other let-down I find of the linux file permissions system is the fact that if you want to make your entire /home/$USER partition, for example, just 600, you quickly come up with a problem that although you can access the files as you would expect, you can't do an 'ls' or anything inside a directory, because the directory itself has to be 'executable' for this.
Anyway got any ideas on how to fix this with one command [eg how to chmod recursively differently, depending on whether it's a file or a directory[?

dxdad 03-22-2004 08:45 AM

Oh, yes, I'd have to say the windows way is a pain to get to and alter, I just like being able to have many users able to access certain files in different ways.

the actual thing I want to do is: The files for the webserver are owned by apache:apache. They need to have the group "apache" so that php scripts running via the webserver can alter files as needed. And yet I don't want to log in as "apache" so i need to be in the group "apache" so I can modify/delete etc.

Maybe I'm just doing things rather awkwardly and other people have a more logical way to do it.

As for your problem I can't help. I always assumed if the directory as readable you could "ls" in it. Maybe you can use ls to recursivly list just the names of diectorys and somehow pipe each line of the output to chmod ? <- maybe that's just me trying to do something not possible?


All times are GMT -5. The time now is 10:49 PM.