Have I Messed Up my Ownership and/or Permissions?

EDIT: I tried doing an “su” and realized I never set up a root account when I started up the system for the first time. I’m assuming that’s the problem. I’ll have to look around and see if I can figure out how to fix that. If someone happens to know how to do that, please let me know.

OP:Yesterday, I re-installed Fedora 35. Because the automatic partitioning part of the previous install didn’t give me my own /home partition, I lost all my data. Knowing this would happen, I prepared by doing a “tar -cvpzf …” on my /home folder and restored everything (on my new, separate /home partition) with “tar -xvpzf …”. But, I’m now having trouble copy files to non-home areas of the file system.

For instance, right now, I’m trying to copy my Windows fonts (from a backup image) over to /usr/share/fonts. There’s no indication that anything in that path is locked (or requiring sudo). But, in that folder, I can’t paste my fonts. Nor can I create a subdirectory there to stick them in. When I try to copy things there, I get:

Error while copying ‘xxx’.
There was an error copying the file into /usr/share/fonts.
Error opening file ‘xxx’: Permission denied

I get the same kind of issue trying to copy .desktop files into /usr/share/applications. I never get any prompts for elevation.

If I navigate there in a terminal window, and do an ll at various points, I get:

- In root:  drwxr-xr-x.  14 root root  4096 May  8 22:40 usr
- In /usr:  drwxr-xr-x. 398 root root  12288 May  9 07:47 share
- In /usr/share:  drwxr-xr-x.   42 root root  4096 May  8 22:51 fonts
- In /usr/share/fonts:  rwxr-xr-x. 2 root root on all the files.

Everything all down the path seem to be owner/group of root.

Doing an id in the console says:

uid=1000(dave) gid=1000(dave) groups=1000(dave),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

In a properly configured system, what are these things supposed to be? Is there any way for me to make things right?

Well, I thought the lack of a password on the root account might have been the problem. But, it’s not. I did a

I found references to system-config-users as a means of changing the password. But, that seems to have disappeared. So, I tried kuser. It had problems running, but it showed the root account was disabled (since it had no password). I added a password, it activated the account, and then threw various errors (and re-disabled the root account). So, then I did:

sudo passwd root

and that let me set the password. Doing a “su” worked. But, I still can’t copy anything into those locations (as just me – I didn’t try as root).

I also saw references to others who didn’t get prompted to set a root account password on first signon. Various responses seem to say that Fedora has disabled the root account password on purpose, doesn’t prompt to set it, and expects us to use sudo.

I guess that’s not a problem. But, it still leaves me trying to figure out why I can’t modify non-home parts of the file system.

(Edit: mistyped ‘other’ permissions as r-w instead of r-x)

/usr, /usr/share, and /usr/share/fonts should all be drwxr-xr-x (nnn) root root, so you’re fine there. Copying files to /usr/share/fonts will require either sudo or changing your id to root. You’re saying you don’t think copying to /usr/share/fonts should require sudo. Am I missing something, did I read your message too quickly?

That’s about right. I know that prior to re-installing, I’d copied .desktop files into usr/share/applications without problem (I don’t remember if it asked for elevation). I wouldn’t have thought fonts would require permissions. But, if so, that’s fine. The problem is I don’t get asked for credentials anywhere. I really don’t want to run through the file system as “su”. But, I don’t know how I’ve managed to mess this up or how to fix it.

I wonder if I should just re-install again since I don’t think I’ve made too many changes yet.

Also, you said the permissions should be drwxr-xr-w. But, I’m seeing drwxr-xr-x. If I’m understanding this correctly, your version says All Users have write access. While mine says All Users have Execute? Maybe that’s the issue? Of course, how it got that way is a mystery.

The permissions on those directories says only root can create files there, which is correct. Likely when you previously added those files, you did it with sudo. No harm there. And sorry, typo on permissions, should be drwxr-xr-x.
Other files that you’re restoring that weren’t in your home directory may be subject to the same restrictions on directory ownership.

OK. It’s odd that I seem to remember being prompted for elevated permissions when I tried doing something that required them. Now, I’m not getting that. I tried copying things from my home directory to these /usr/share ones. In Dolphin, it just pops up that error message. No recourse at all. In a console, it also just errors out. But, if I run those cp commands with sudo up front, then it works. I THOUGHT in a console I used to get some kind of reference to having to run as sudo. But, I can’t swear to it.

There were a lot of system updates over the last couple of days (in preparation for Fedora 36, I think). I wonder if they changed some behavior? Or, I could just be losing my marbles.

Anyway, thanks for the help.

I lose marbles frequently, but in a gazillion (~45) years of shell command line work, I’ve never seen a message from cp and its friends about needing sudo, only that I don’t have permissions. This is not related to Fedora 36 and behavioral changes, sorry, and if there were F36 behavioral changes, you’d not see them in F35 and prior.
I don’t recall how to elevate your privileges for file activity with Dolphin as I very rarely use a GUI for file management, but I’m sure many others who do can answer that.
Glad you’ve got this one under control, now you can freely charge up the next hill around restoring the remaining files. Good luck

I do not use dolphin as I am using gnome. However the file manager (nautilus) does not ask for elevated permissions, it just fails like what you see.

When starting apps or settings that require elevated permissions some (such as those in the gnome settings panels) ask for elevated permissions and use sudo to achieve that. That action is a feature built in to the gnome settings and not part of the main system. Many (if not most) apps are not integrated enough to ask for permissions and just fail when unable to write.