14

I just answered another beginners question about "Cannot write.......check permissions".

Of course I know how to use chown/chmod; I'm working with command line anyway. But the average consumer does not.

So what should I tell people without any GNU/Linux-experience?

Work as root? I know for example Nemo has functionality "open as root". But just no! I do not think it is a good idea for an average user. It's far to dangerous. Then the user creates file in root-file-manager and wonders why he cannot delete or modify this file. And so on.

Tell him to learn how to use chown/chmod? And here we are - nerd-only-linux where everything is so complicated. That's the way we do things; but it's no good option for the average consumer.

Why doesn't the file-manager help?

I hate to say this, but look how Windows handles this. Default are user-permission. And if the file-manager needs more - it just asks the user.

This can't be hard to implement. If an operation fails with permission exception - try executing with gksudo.

And yes: I'm really inexperienced with the whole Open-Source-World.

My questions:

  1. Are there any reasons this isn't done this way
  2. Did anyone implement something like that?
  3. Is this something you report as a bug (Ubuntu or e.g. Gnome)?
  4. Is this something I just could try to implement myself?

closed as primarily opinion-based by muru, Zanna, Jacob Vlijm, Arronical, MadMike Mar 22 '17 at 7:33

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    Why do you want to copy Windows behaviour to a Linux system? They are just two different operating systems and also differ. In Linux you work as normal user and normally do not need root privileges, unless you do admin work. In that case, you should work as admin and keep both worlds separated. You can install software in your home directory, make your own environment settings in .bashrc, .profile etc... – Thomas Mar 21 '17 at 11:06
  • 2
    I must be missing something, but why do you consider "I know for example Nemo has functionality "open as root". But just no! I do not think it is a good idea for an average user. It's far to dangerous.", but at the same time, "look how Windows handles this. Default are user-permission. And if the file-manager needs more - it just asks the user" -a good idea? Que? – Jacob Vlijm Mar 21 '17 at 11:38
  • 5
    To close voters: seriously? This is an excellent question and already has a very good answer. With probably more to come. If there are any technical reasons for not implementing this obvious improvement then an answer can be given. – Andrea Lazzarotto Mar 21 '17 at 11:50
  • 2
    @Arronic the point is there are no such GUI tools for a lot of cases. Even macOS has more GUI options for tweaking the firewall, the SSH server and so on. So the question of the OP is: why? – Andrea Lazzarotto Mar 21 '17 at 13:15
  • 3
    If Linux on the desktop for non-technical people is going to go anywhere, it needs to completely remove the need to ever work in a file manager as root, ever. I can't think of anything a normal user should have to do in a file manager as root (of course, there are plenty of things they currently do have to do). Then this problem is solved rather easily. IMHO, if users are creating root-owned files in their own home directories, something is already seriously wrong. – Muzer Mar 21 '17 at 13:40
14
  1. Are there any reasons this isn't done this way

There aren't any specifically. I can name a few supposed reasons, but they'd be mostly speculation.

  1. Did anyone implement something like that?

Not quite. There is nautilus-admin extension which will allow you to open a directory in a new window with root-level privileges, and then you can change file/directory permissions as you wish from the right-click menu-> Properties->Permissions.

  1. Is this something you report as a bug (Ubuntu or e.g. Gnome)?

Bug report ? No. Feature request ? Potentially, yes. You can submit this as feature request to Nautilus ( the filemanager ) team on Launchpad, but I suspect with 90 % certainty they'll point you in the nautilus-admin extension I mentioned above.

Install it with sudo apt-get install nautilus-admin.

  1. Is this something I just could try to implement myself?

Yes, if your file manager allows adding scripts to it. The default file manager for Ubuntu (Nautilus) does allow adding scripts to it, so you could do something like this:

#!/bin/bash
# adds read permissions for file for all users
zenity --password | sudo -S -p ""  chmod +r  "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" || zenity --error --text "Command failed"

Place that into ~/.local/share/nautilus/scripts, make executable with chmod, and then it will be accessible via right clicking on file. Of course that's a minimal example just to show the point. If you want a full blown app that allows more complex features like selecting which permissions to alter, well, that might require extra commands and probably a language like Python with more powerful GUI toolkits.

But just no! I do not think it is a good idea for an average user. It's far to dangerous. Then the user creates file in root-file-manager and wonders why he cannot delete or modify this file. And so on.

Well...It's not a computer problem - it's user problem. We can't fix the user not willing to learn how to properly operate their computer and not taking responsibility for their actions.

Users have to realize that the separation of ownership in files exists for a reason. You can't have both power to change permissions on file and not expect security implications with that

  • 4
    Excellent answer, however the problem remains: the GUI on most distros by default doesn't allow a user to "sudo graphically" when needed. Either the user must manually unlock the root account (bad) or they must resort to the command line. For instance I am a developer, I like the CLI... But I also think about my family and friends who are not. Sometimes when they use Linux they ask me for help and 80% of the time is about doing something as a privileged user. :/ – Andrea Lazzarotto Mar 21 '17 at 11:49
  • thanks; especially the script is quite useful. A feature request is reported like a bug (with note that this is a feature request), isn't it? – AnnoSiedler Mar 21 '17 at 12:05
  • @AnnoSiedler broadly speaking yes; it's better if you put "[enhancement]" or "[feature]" in the title and start with a good user story, and do not present your issue as a flaw (e.g "steps to reproduce the bug") – david.libremone Mar 21 '17 at 12:29
  • 16
    “Well...It's not a computer problem - it's user problem. We can't fix the user not willing to learn how to properly operate their computer and not taking responsibility for their actions.” Uh, no. People throwing hands up and blaming the users is exactly why things get convoluted or counterintuitive. UX design is a real, important thing that program designers need to care about, think about, work on—in other words, take ownership of and responsibility for. It’s not users’ fault—it’s a technical limitation, or a security concern, or maybe, it’s bad UX that needs fixing. – KRyan Mar 21 '17 at 12:40

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