0

For any given file in the web root, the permissions are initially set to me:www-data with chmod 750. Opening a file in an editor and saving via the editors save command changes the group to me:me. How do I prevent group changes on save?

Nick
  • 579

2 Answers2

1

Linux saves the file using your active group, so change your active group before you edit.

Easiest method is to change your primary group.

You can do this temporarily with newgrp , this command starts a new shell

newgrp www-data
gedit your_file
exit

If you want to change your primary group permanently, use usermod

usermod -g www-data your_user 
Panther
  • 102,067
0

This seems to be a bug (LP #199167).

You could try to open your editor as www-data using gksudo -u www-data gedit.

Louis Matthijssen
  • 11,885
  • 6
  • 44
  • 50
  • It may be related to that bug... but that's a really old bug! Opening as www-data wouldn't help because www-data should not have write permissions to the files for security reasons. – Nick Apr 24 '14 at 13:09