I’m trying to update my grub boot order back to booting the first option instead of the second, so I run sudo nano /etc/default/grub
, but it brings up this, which is not the file I want to edit.
I’m on fedora 38
What distro?
Fedora 38
Well, if you look at the file… and search the internet for “fedora edit grub entry not possible” that works.
You use grub2-mkconfig to create this file, and what you want to change it in another file that is used to create this one.
The thing is, what do you want to edit?
I want to edit the grub config, to change the default boot order
Did you already do an internet search? Positive you will find that answer
so I run
sudo nano /etc/default/grub
For improved security during file edits that require root access, it’s highly advised to use
sudoedit
(orsudo -e
). This method is considered the standard practice to avoid the security pitfalls associated with directly invoking editors withsudo
. To ensure the use ofnano
withsudoedit
, simply set theVISUAL
environment variable withexport VISUAL=nano
before runningsudoedit
. Alternatively, for a one-off command:VISUAL=nano sudoedit /path/to/file
.Please note that while
sudoedit
is a safer starting point, it’s not the only method available. Alternatives such asdoas
,doasedit
, or leveragingpolkit
withpkexec
can offer even more controlled and secure ways to manage file editing with elevated privileges. However, it’s perfectly acceptable to stick withsudoedit
, as it’s a commonly trusted tool.Be aware that direct usage of
sudo nano
or other editors is strongly discouraged. It bypasses important security mechanisms and can lead to inadvertent system-wide risks.EDIT: changed
VISUAL=nano sudoedit
toVISUAL=nano sudoedit /path/to/file
.Never heard of sudoedit. I want to experiment with a system where I
alias sudo=pkexec
, VanillaOS does that