This is a permissions problem, not an ownership problem.
Execute permissions (abbreviated x
and appearing where the -
is in rw-
) are conspicuously absent from the permissions you've shown us.
Execute permissions work very differently for directories than for regular files. For directories, execute permissions give the ability to enter the directory (that is, to cd
to it, or to open it up in a file manager). They also give the ability to attempt to access files in the directory (though whether or not that will succeed also depend on other permissions, sometimes including the permissions of the files being accessed).
root
is able to enter the directory because it is not really bound by permissions in the usual way. In many ways, commands and applications that are run as root
will try to respect permissions in order to abide by the wishes of the user. But root
has the power to perform any operation (that the OS is capable of performing) on any file or directory. In a root
shell, cd
ing into a directory that doesn't have any execute permissions will succeed.
The solution to the problem is to run:
chmod u+x masternotes
That gives (+
) the owner of masternotes
(u
) executable permissions (x
) on the directory.
Then you'll be able to enter into the directory and attempt to access files there, as a normal user.
If you want members of its group owner to be able to do this too, then you could run this instead:
chmod ug+x masternotes
But you are probably the only member of your user-specific group (which owns the folder).
The chmod
command here does not need to be run as root
--it is deliberate that I have not included sudo
in either command. You own the folder, so you can change its permissions yourself--you don't need root
to do it for you.
In case you're interested in setting execute permissions numerically, remember that for each digit you add (starting with zero):
- 4 for read.
- 2 for write.
- 1 for execute.
For example, if you wanted everyone to be able to read and execute some-file
but only the owner to be able to write, you'd use:
chmod 755 some-file
I recommend FilePermissions in the community documentation, for further reading on file permissions in Ubuntu, including the executable bit and its special meaning for folders.