I try to save /etc/default/grub after making edits, but I don't have permission and only the owner can change permissions. How do I become the owner?
Asked
Active
Viewed 208 times
0
Radu Rădeanu
- 166,822
- 48
- 327
- 400
-
Why do you want to change the permissions and owner, you are inviting trouble. – jobin Apr 23 '14 at 18:05
-
Is it not "root/root"? – Elliott Frisch Apr 23 '14 at 18:07
-
I wouldn't change the permissions. Just edit it as root using `sudo` (su is superuser aka administrator): `sudo nano /etc/default/grub`. – Louis Matthijssen Apr 23 '14 at 18:11
-
So what is the issue if you are using sudo? – jobin Apr 23 '14 at 18:24
1 Answers
3
The best way to edit system files is to open them in a text editor with root permisions.
So:
sudo nano /etc/default/grub
or as Radu Rădeanu suggested:
gksu gedit /etc/default/grub
will work perfectly.
You might want to make a backup copy in case you mess up:
sudo cp /etc/default/grub /etc/default/grub.backup
To restore:
sudo rm /etc/default/grub
sudo mv /etc/default/grub.backup /etc/default/grub
It's not a good idea to change ownership of system files.
-
1[Never use `sudo gedit [...]`](http://askubuntu.com/questions/270006/why-user-should-never-use-normal-sudo-to-start-graphical-application). – Radu Rădeanu Apr 23 '14 at 18:34
-
-
1