Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1024  / 3 Years ago, thu, september 2, 2021, 4:15:09

I've created a Nautilus Action to edit files with sudo (gksudo) and the text editor that opens the file is always using a different configuration from the normal user.



The same thing happen when I run sudo gedit file or sudo subl file



Can I fix this or is it a security measure?


More From » sudo

 Answers
1

What happens in your case is that probably the configuration contains the option always_set_home which switches the home directory and thus the configuration to /root.



Solutions:




  • You can use sudoedit for this purpose, which will preserve your environment.

  • You can check your sudo configuration using sudo visudo and comment out the always_set_home option

  • You can use sudo -E gedit file to preserve the environment



I'm not aware of any security implications, but of course nasty things will happen if someone replaces the gedit configuration file with a symlink to a system file. But if you use sudo gedit it is assumed that you know what is going on on your system.


[#33766] Friday, September 3, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
uffno

Total Points: 283
Total Questions: 93
Total Answers: 111

Location: Saint Vincent and the Grenadines
Member since Thu, Oct 15, 2020
4 Years ago
uffno questions
Thu, Sep 2, 21, 18:08, 3 Years ago
Sun, Apr 2, 23, 15:15, 1 Year ago
Sat, Jan 8, 22, 16:37, 2 Years ago
;