Hey Guyz. I think many of you don’t Know about Linux File Permissions and Ownership.
As, Linux is a multi user system.
In Linux every file has an owner and permissions assosiated with that. the command chmod is used to modify permissions.
Many of you used chmod 775 filename see this 111 111 101 this is the binary form of 775. Here the 3 1’s means 111==> rwx.
In these 3 digits 775,
the first 7, on hundreds place shows the permission to the owner of the file.
the second 7 on tens place shows the permission to the group to which owner belongs. In Linux every user belong to a group and
at ones place 5 is used for other users. that means anyone has account on that linux system can access that file.
when you do chmod +x filename you give execute permissions to owner, owner group and other user which means anyone can execute that file.
Here the owner of z.txt file is crio-user where as z1.txt is root which is super user and has all admin rights.
as root has admin rights so he can do whatever he wants but crio-user is a normal user so he can’t see the contents of z1.txt file which is owned by root.
Now crio-user is the owner of z1.txt so he/she will be able to see the content of the file.
Now Lets talk about executing a file.
on 1 command see vsftpd_secure doesn’t have execute permissions.so when i used sudo ./vsftpd_secure ./vsftpd.conf It gave me an error that command not found.
In next line i gave execute permission to the file. so server started in next line.
Hope you have learnt something about Linux File Permissions.