Running sublime as root in Fedora

I have looked online with a lot of different solutions. They all do not work with my environment but one, sudo -H subl

I have tried a couple of thinks online, including one that looks to work for the ubuntu env by editing the application laynch, which is what I would prefer over exec in terminal sudo -H subl

Does anyone work with Sublime and can run it as root? my local dev env apache neds to owns the files for files creation etc. I run www/ as apache:myuser as group. But sublime needs to run as root to updated the files without it asking for sudo pass constantly.

Any help appreciated

I dont think this is how it should work. Doesnt sublike have polkit integration? Or I guess that is already what it does when asking for a password all the time.

You should contact the devs or use a different editor, if you ask me.

Possible workarounds:

  • Set up key-based SSH authentication for root and then access the files through the mount point:
gio mount sftp://root@localhost/
gio open sftp://root@localhost/
  • Relax requirements for Polkit authentication:
sudo tee /etc/polkit-1/rules.d/00-pkexec.rules << EOF > /dev/null
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.policykit.exec"
&& subject.isInGroup("wheel")) {
return polkit.Result.YES;
}});
EOF

polkit: Authorization Manager | polkit System Administration | Man Pages | ManKier

1 Like