1

I've installed apache server on Ubuntu 16.04. Now I want to access with admin access frequently. Till now I've used following command :

gksu nautilus

Since few days ago. It's not working at both of my PC. When I enter this command verification prompt for password pops up. I enter password and new nautilus window also opens, but when I want to paste/write anything in that folder, It's giving me the message in a new window that

Permission Denied

I've also tried with

sudo nautilus

but same result as well. It's important to mention that, I can use other commands with sudo without any issue!!! It's really annoying. I want to access the root folder within GUI just like before. How can I do that? Please help.

  • 1
    sudo -H nautilus – user589808 Apr 16 '17 at 8:28
  • @CelticWarrior sorry this isn't working for me. Same output as before. – tuxtu Apr 16 '17 at 8:54
  • Is gksu nautilus immediately returning permission denied before asking for a password? Can you run any sudo command successfully? What happens if you run sudo apt-get update ? – Will Apr 16 '17 at 12:12
  • @will gksu nautilus isn't immediately returning Permission denied. It's only comes up when I want to paste/write something in the root folders. Besides I can run other sudo commands smoothly. I can update using sudo. – tuxtu Apr 17 '17 at 3:42
  • 1
    @CelticWarrior thanks your solution is working properly today!!! I think that's the solutionI was looking for :). Please post it as answer. – tuxtu Apr 17 '17 at 5:21
3

Graphical apps should not run with sudo due to the risk of messing with the permissions in the userspace.

gksu used to be the way to go but now the preferred way is sudo -H. According to man sudo,

-H, --set-home
             Request that the security policy set the HOME environment
             variable to the home directory specified by the target user's
             password database entry.  Depending on the policy, this may
             be the default behavior.

The command you're looking for is sudo -H nautilus

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.