In contrary to Microsoft the maintainers of Linux had and have a very strong sense of security: Linux is a multi-user system even if most of us only have one user using is. It means documents need to be protected from users that are allowed on your system.
So Linux/Ubuntu works with permissions on disks, partition, directories and files and those permissions come in a set of 1 group of permissions for owner, 1 for a group and 1 for others and those also come in 3 parts: the ability to read, write and/or execute files. A lock icon means you do not own that location.
An example...
- In case of a new installations partitions are owned by owner
root
and group root
.
Start a terminal session as we mostly do this from command line: it is uniform and works on a lot of Unix-based systems.
1st: a partition needs to be mounted as writable before you can alter permissions.
This is what my partition (discworld
) looks like after an initial install:
$ ls -ltr /
...
drwxr-xr-x 14 root root 4096 okt 25 18:40 discworld
...
This is what you do to own it:
$ cd /
$ sudo chown $USER:$USER discworld -R
$ ls -ltr /
...
drwxr-x--- 14 rinzwind rinzwind 4096 okt 25 18:40 discworld
...
At the front you see the 3 sets for read, write and execute:
d
for directory
rwx
for the owner (1st rinzwind
)
r-x
for the group (2nd rinzwind
)
---
for others
So the owner rinzwind
can read, write and execute, the group rinzwind
can read and execute, but not write, others can do nothing to my partition. Others is everyone not user root
, not the owner, and not the users part of the group.
The rwx
part is set with the chmod
command but that is not really required for the answer to your question though needed for the concept of permissions. The owner is what creates the lock icon.
The $USER
is a universal variable that holds your current user. For single user desktop it is the admin; if you need another user change it to the actual name.
-R
means it is applied to all the content of the partition: all the files and directories in it get the same owner and group. Drop it if you ever need to apply it to a single item.
In the example I used a partition, but the same works for directories and files.
Be careful to ONLY do this with PERSONAL files. You can totally wreck your system with a single chmod
or a single chown
: the base system requires files to have specific permissions and owners and groups.
And this allows you to write, delete and read the contents, and it will remove the lock icon.