LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   user permissions changing after using gedit (https://www.linuxquestions.org/questions/linux-newbie-8/user-permissions-changing-after-using-gedit-626136/)

linuxmandrake 03-06-2008 07:58 AM

user permissions changing after using gedit
 
Hi
I have a folder that's only supposed to be editable by it's owner and anyone belonging to the dev user group. Hence the folder and it's contents have 775 user permissions. But if you belong to the dev usergroup and edit files, the owner gets changed to the current user and the usergroup gets changed to the curren users default usergroup. Is there a way to stop this

I'm using ubuntu gutsy.

alan_ri 03-07-2008 05:25 PM

Shouldn't 775 be rwxr-----

catweasel28 03-08-2008 07:31 AM

Either.......Or
 
Actually what's happen is perfectly logical.
Permissions 775 is rwxrwxr-x, which means that not only the owner but anyone else in the owner's group can edit the file. When they save it, they become the owner. Also, do the files need to be executable. If not, open up a shell in the relevant directory and type:

sudo chmod 644 *

then run

ls -lh

You'll see all the file permissions as rw-r--r--

That way, only you'll be able to edit the files.

alan_ri 03-08-2008 07:47 AM

It can not be 644 because then all the others could read it and the OP don't want that.

catweasel28 03-08-2008 07:53 AM

Quote:

Originally Posted by alan_ri (Post 3081987)
It can not be 644 because then all the others could read it and the OP don't want that.


If permissions are, as linuxmandrake says, 755 - then others can not only read but execute the files. If you don't want others to be able to do anything to the files, you'll have to issue:

sudo chmod 640 *

You'll then be safe from prying eyes!:tisk:

alan_ri 03-08-2008 08:04 AM

Quote:

Originally Posted by catweasel28 (Post 3081992)
If you don't want others to be able to do anything to the files, you'll have to issue:

sudo chmod 640 *

Just what I said in my first post.


All times are GMT -5. The time now is 01:05 PM.