Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Geany as root

I have ubuntu 16.04 and I installed Geany using Ubuntu Software Centre. I need to edit some php and js files which happen to be in root directories. So when I try to save the changes in Geany, it generates following error:

Error opening file '/var/www/html/project1/team/team.php': Permission denied

The file on disk may now be truncated!

How can I make Geany to edit and save these files?

like image 575
Ankit Shubham Avatar asked Dec 18 '25 23:12

Ankit Shubham


2 Answers

try

gksudo geany

Use gksudo with graphical apps written in GTK+ instead of sudo

like image 112
Shady Atef Avatar answered Dec 20 '25 14:12

Shady Atef


sudo -Eb geany

worked for me on Debian 10 with xrdp. I executed the command on xrdp desktop Terminal Emulator.

-E: preserve user environment when running command
-b: run command in the background

Note that without -b option the control will not return to terminal until geany is closed.

Not an expert on this, was just trying to see sudo's options and this did the trick!

like image 36
Uttam Avatar answered Dec 20 '25 13:12

Uttam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!