File Permission in Linux

 Although there are already a lot of good security features built into Linux-based systems, based upon the need for proper permissions. Wrong file permission may open a door for attackers in your system.

Group Permission

    Owner—The Owner permissions apply only the owner of the file or directory; they will not impact the actions of other users.

       Group—The Group permissions apply only to the group that has been assigned to the file or directory; they will not affect the actions of other users.

        All User/Other—The All Users permissions apply to all other users on the system; this is the permission group that you want to watch the most.

Each file or directory has three basic permission types:

     Read—The Read permission refers to a user’s capability to read the contents of the file. 

     Write—The Write permissions refer to a user’s capability to write or modify a file or directory. 

        Execute—The Execute permission affects a user’s capability to execute a file or view the contents of a directory.

File permission is in following format. 

Owner Group Other/all

     root@Net:~# ls -al

 We will talk about aforementioned command later on in this post.

         -rwxr-xr-x 1 net tut 77 Oct 24 11:51 auto run 

        drwx------ 2 ali tut 4096 Oct 25 2012 cache 

File auto run permission 

        -—No special permissions 

        rwx—Owner (net) having read, write, and execute permission while group (tut) having read and         execute and other also having same permission. 

File cahe permission 

        d—Represent directory 

         rwx—Owner (ali) having read, write, and execute permission while group (tut) and other/all                 does not have any permission for accessing or reading this file.

Linux Advance/Special Permission

    l—The file or directory is a symbolic link

    s—This indicated the setuid/setgid permissions. Represented as a s in the read portion of the              owner or group permissions.

    t—This indicates the sticky bit permissions. Represented as a t in the executable portion of the all             users permissions

     i—chatter Making file unchangeable

There are two more which mostly used by devices.

        c—Character device

        b—Block device (i.e., hdd)

some examples

        Link Permission

                root@net:~#ln -s new /root/link

                root@net:~#ls -a

                lrwxrwxrwx 1 ali ali 3 Mar 18 08:09 link -> new

                link is created for a file name called new (link is symbolic for file name new)

Comments