[kwlug-disc] How does a Newbie use the Ubuntu GUI to copy files into dirs owned by Root?

unsolicited unsolicited at swiz.ca
Wed Jul 6 16:42:33 EDT 2011


John Johnson wrote, On 07/06/2011 3:17 PM:
> 
> How does a Newbie use the Ubuntu GUI to copy files into directories 
> owned by root?
> 
> After a few months away from my Ubuntu/LAMP/web-server I have returned 
> to it to update my website(s) on the server.
> As an old UNIX hack, I can move around in a terminal window and use the 
> command line to move files around with "sudo [command]".
> 
> I found that cannot use the GUI to move or copy files into directories 
> owned by root, such as /var/www/[website-name-here].
> Understandably, I get permissions errors logged in as a typical login 
> user. And I found that logging in as "root" is a non-starter.
> 
> I am sure I can go back to the command lime and do a sudo chmod xxx 
> /var/www/[website-name-here] to open up the access.
> But I would like to know if there is a GUI equivalent to "sudo cp source 
> dest" where "dest" is owned by root (or other).
> 
> BTW: I am not even sure what GUI is running, but I do not think it is 
> Unity. Unity would not run on my ram-starved PC.
> How can I tell what GUI is running?

(Unity isn't a gui, but I'll let others deal with that. Precisely what 
it is, I'm not sure off the top of my head. Grey.)


In kubuntu, so translate for gnome, either:
- Alt-F2 (gui command line) kdesu konqueror (kfm-client? Essentially a 
konqueror call using the file management profile)
- from a terminal windows, [kdesu | sudo | su] by itself to start a 
sub-shell as root, then call konqueror as above, or just use the same 
command line above. Perhaps with an appended &. (konqueror being the 
gui equivalent to windows explorer. Later kde distros default to 
dolphin, instead of konqueror.)

Note: For the longest time, one could not start a gui program from the 
command line, they didn't know where the screen was. Starting some few 
versions ago, this changed, so calling gui programs from the command 
line now works.

Change the above appropriate for gnome and you're probably good to go.

- kdesu is simply a gui, display aware, version of su.
- there is a gnome equivalent, but I can't recall it at the moment. gdesu?
- there will be other display manager equivalents.

[tab filename completion can be your friend at the command line.]


There is a larger issue of what are, let alone using, appropriate 
permissions, and I am certainly no expert. They involve, IIRC, in the 
destination directory, if owned by root, setting the group to 
non-root, and your gui userid being part of that group. (As should be 
root?)


Arguably, where you're destined should not be root. Practically, one 
does not figure this out (let alone what is appropriate), until long 
after one broke down and wrote the files as root. Creating the 
problems you are experiencing now, I suspect.

For example, /var/www, IIRC, should be owned by Apache group, so add 
yourself to the Apache group.


Common issue, most everyone runs into it. There's a fair learning 
curve to what should be where, when, and usually at that stage in 
experimentation we just want to get on with our day, so become root.

Giving the grief, probably, that you are experiencing now.

And leading to the need, as you are discovering, to go back and 
refactor permissions as they should be.


Links to where this stuff is suitable explained would be welcome.




More information about the kwlug-disc mailing list