Enhance your Career in Networking With IPinBits!!!​

Linux for network engineers – file Ownership

Taking further our Linux for network engineers, today we will study about the FILE PERMISSIONS  in linux. But why do need it? – Because linux is a multi-user operating system which can be accessed by many users simultaneously. So who access what is a security concern which should be addressed. It is same as privileges provided to user at enable/conf terminal in cisco ios.

For effective security, Linux divides authorization into two levels:-
1. Ownership
2. Permission

There are three types of owners defined in linux system. Every file/directory is assigned one or more owners. Let’s discuss them one by one :-
1. USER – This is who created a file/directory. Hence sometimes a USER is also called owner. A user can create, delete, or modify the file.
2. GROUP – A group can have multiple users – Suppose a project or NOC where multiple people need access to the system. All the users belonging to a group have same access permission for a file.
3. OTHERS – Any other user who neither created file nor is the member of the group falls under this category.

We can see this using below method :-

To know the local users account, following command can be used. It list out all the local users from the system.

Syntax: cut -d: -f1 /etc/passwd | column  

Now since we know about the file owners and group. Let’s see how can we change the ownership.
To change the owner, we have “chown <new owner> <file name>”

To change Owner as well as group we can use “chown <new owner>:<new group> <file name>”command :-

That’s all for Linux Ownerships, let’s see the linux permissions in this article -> LINUX FILE PERMISSIONS

Related blog posts