[Samsung Galaxy Grand Quattro] Arinio:
Android File System Permissions : A Detailed Discussion

In this tutorial we will discuss in details the filesystem permissions for Android OS.

Let us jump into the topic and learn by practical example.

We will start with:

arinio@ubuntu:~$ adb shell

shell@android:/ $ su -

root@android:/ # cd /dev

root@android:/dev # ls -al

---------- root root 0 2013-12-12 01:52 .coldboot_done

drwxr-xr-x root root 2013-12-12 01:52 adsp

crw-rw-r-- system radio 10, 81 2013-12-12 01:52 alarm

crw-rw---- adb adb 10, 87 2013-12-12 01:52 android_adb

crw------- root root 10, 89 2013-12-12 01:52 android_mbim

crw------- root root 251, 10 2013-12-12 01:52 apr_apps2

crw-rw-rw- root root 10, 78 2013-12-12 01:52 ashmem

crw-rw-rw- root root 10, 79 2013-12-12 01:52 binder

drwxr-xr-x root root 2013-12-12 01:52 block

crw------- root root 10, 85 2013-12-12 01:52 ccid_bulk

crw------- root root 10, 86 2013-12-12 01:52 ccid_ctrl

drwxrwx--- u0_a49 u0_a49 2013-12-12 01:53 com.mgyun.shua.su

crw------- root root 5, 1 2013-12-12 01:52 console

crw------- root root 10, 71 2013-12-12 01:52 cpu_dma_latency

drwxr-xr-x system system 2013-12-12 01:52 cpuctl

crw------- root root 10, 236 2013-12-12 01:52 device-mapper

crw-rw---- system qcom_diag 245, 0 2013-12-12 01:52 diag

crw------- root root 10, 121 2013-12-12 01:52 dsp_debug

crw------- system system 10, 82 2013-12-12 01:52 dun

crw------- root root 10, 94 2013-12-12 01:52 ecryptfs

crw-rw-rw- root root 1, 7 2013-12-12 01:52 full

crw------- root root 10, 229 2013-12-12 01:52 fuse

crw-rw-rw- system system 10, 92 2013-12-12 01:52 genlock

drwxr-xr-x root root 2013-12-12 01:52 graphics

crw------- root root 89, 0 2013-12-12 01:52 i2c-0

crw------- root root 89, 2 2013-12-12 01:52 i2c-2

crw------- root root 89, 3 2013-12-12 01:52 i2c-3

crw------- root root 89, 4 2013-12-12 01:52 i2c-4

crw-rw---- media media 89, 5 2013-12-12 01:52 i2c-5

crw------- root root 89, 6 2013-12-12 01:52 i2c-6

crw------- root root 89, 7 2013-12-12 01:52 i2c-7

crw------- root root 10, 93 2013-12-12 01:52 idle_stats_kgsl-3d0

drwxr-xr-x root root 2013-12-12 01:52 input

crw-rw-r-- system system 10, 127 2013-12-12 01:52 ion

crw-rw-rw- system system 244, 0 2013-12-15 10:15 kgsl-3d0

crw------- root root 1, 2 2013-12-12 01:52 kmem

crw------- root root 1, 11 2013-12-12 01:52 kmsg

drwxr-xr-x root root 2013-12-12 01:52 log

crw------- root root 10, 237 2013-12-12 01:52 loop-control

crw-rw---- system camera 253, 0 2013-12-12 01:52 media0

crw-rw---- system camera 253, 1 2013-12-12 01:52 media1

crw-rw---- system camera 253, 2 2013-12-12 01:52 media2

crw------- root root 1, 1 2013-12-12 01:52 mem

drwx------ system system 2013-12-12 01:52 memcgrp

crw-rw---- system audio 10, 109 2013-12-12 01:52 msm_aac

crw-rw---- system audio 10, 118 2013-12-12 01:52 msm_aac_in

crw-rw---- system audio 10, 98 2013-12-12 01:52 msm_ac3

crw-rw---- system audio 10, 72 2013-12-12 01:52 msm_acdb

crw------- root root 10, 80 2013-12-12 01:52 msm_adc

crw-rw---- system audio 10, 110 2013-12-12 01:52 msm_amrnb

crw-r----- system audio 10, 108 2013-12-12 01:52 msm_amrnb_in

crw-rw---- system audio 10, 105 2013-12-12 01:52 msm_amrwb

crw-rw---- system audio 10, 102 2013-12-12 01:52 msm_cad

drwxr-xr-x root root 2013-12-12 01:52 msm_camera

crw-rw---- system audio 10, 112 2013-12-12 01:52 msm_evrc

crw-rw---- system audio 10, 117 2013-12-12 01:52 msm_evrc_in

crw-rw---- system audio 10, 101 2013-12-12 01:52 msm_fm

crw-rw---- system audio 10, 113 2013-12-12 01:52 msm_mp3

crw-rw---- system audio 10, 100 2013-12-12 01:52 msm_mvs

crw-rw---- system audio 10, 114 2013-12-12 01:52 msm_pcm_ctl

crw------- root root 10, 106 2013-12-12 01:52 msm_pcm_dec

crw-rw---- system audio 10, 120 2013-12-12 01:52 msm_pcm_in

crw-rw---- system audio 10, 99 2013-12-12 01:52 msm_pcm_lp_dec

crw-rw---- system audio 10, 115 2013-12-12 01:52 msm_pcm_out

crw-rw---- system audio 10, 119 2013-12-12 01:52 msm_preproc_ctl

crw-rw---- system audio 10, 111 2013-12-12 01:52 msm_qcelp

crw-rw---- system audio 10, 116 2013-12-12 01:52 msm_qcelp_in

crw-rw---- system audio 10, 103 2013-12-12 01:52 msm_snd

crw-rw---- system audio 10, 95 2013-12-12 01:52 msm_voicememo

crw-rw---- system audio 10, 107 2013-12-12 01:52 msm_wma

crw-rw---- system audio 10, 104 2013-12-12 01:52 msm_wmapro

crw------- root root 10, 97 2013-12-12 01:52 msmdma

crw------- root root 10, 70 2013-12-12 01:52 network_latency

crw------- root root 10, 69 2013-12-12 01:52 network_throughput

crw-rw-rw- root root 1, 3 2013-12-12 01:52 null

drwxr-xr-x root root 2013-12-12 01:52 oncrpc

crw-rw---- radio vpn 108, 0 2013-12-12 01:52 ppp

crw-rw-rw- root root 5, 2 2013-12-15 10:15 ptmx

drwxr-xr-x root root 1970-01-01 05:30 pts

crw-r----- radio radio 10, 124 2013-12-12 01:52 qmi0

crw-r----- radio radio 10, 123 2013-12-12 01:52 qmi1

crw-r----- radio radio 10, 122 2013-12-12 01:52 qmi2

crw-rw-rw- root root 1, 8 2013-12-12 01:52 random

crw------- root root 10, 126 2013-12-12 01:52 rfkill

crw-r----- radio radio 10, 88 2013-12-12 01:52 rmnet_mux_ctrl

crw------- root root 10, 96 2013-12-12 01:52 rmt_storage

crw------- system system 254, 0 2013-12-12 01:52 rtc0

crw------- root root 254, 1 2013-12-12 01:52 rtc1

crw------- root root 10, 91 2013-12-12 01:52 sec_misc

crw-rw---- system system 252, 0 2013-12-12 01:52 smd0

crw------- root root 252, 1 2013-12-12 01:52 smd1

crw-rw---- radio radio 252, 11 2013-12-12 01:52 smd11

crw-rw---- bluetooth bluetooth 252, 2 2013-12-12 01:52 smd2

crw------- root root 252, 21 2013-12-12 01:52 smd21

crw------- root root 251, 8 2013-12-12 01:52 smd22

crw------- root root 252, 27 2013-12-12 01:52 smd27

crw-rw---- bluetooth bluetooth 252, 3 2013-12-12 01:52 smd3

crw------- root root 252, 36 2013-12-12 01:52 smd36

crw-rw---- system system 252, 4 2013-12-12 01:52 smd4

crw------- root root 252, 5 2013-12-12 01:52 smd5

crw------- root root 252, 6 2013-12-12 01:52 smd6

crw-rw---- bluetooth bluetooth 252, 7 2013-12-12 01:52 smd7

crw------- root root 251, 13 2013-12-12 01:52 smd_cxm_qmi

crw------- root root 251, 14 2013-12-12 01:52 smd_pkt_loopback

crw------- root root 251, 12 2013-12-12 01:52 smd_sns_adsp

crw------- root root 251, 9 2013-12-12 01:52 smd_sns_dsps

crw-r----- radio radio 251, 0 2013-12-12 01:52 smdcntl0

crw-r----- radio radio 251, 1 2013-12-12 01:52 smdcntl1

crw-r----- radio radio 251, 2 2013-12-12 01:52 smdcntl2

crw-r----- radio radio 251, 3 2013-12-12 01:52 smdcntl3

crw-r----- radio radio 251, 4 2013-12-12 01:52 smdcntl4

crw-r----- radio radio 251, 5 2013-12-12 01:52 smdcntl5

crw-r----- radio radio 251, 6 2013-12-12 01:52 smdcntl6

crw-r----- radio radio 251, 7 2013-12-12 01:52 smdcntl7

crw------- root root 251, 11 2013-12-12 01:52 smdcntl8

crw------- root root 10, 125 2013-12-12 01:52 smem_log

drwxr-xr-x root root 2013-12-12 01:52 snd

drwxr-xr-x root root 2013-12-15 10:15 socket

crw------- root root 10, 90 2013-12-12 01:52 tgt

crw-rw-rw- root root 5, 0 2013-12-12 01:52 tty

crw-rw---- root system 4, 0 2013-12-12 01:52 tty0

crw------- root root 4, 1 2013-12-12 01:52 tty1

crw------- root root 4, 10 2013-12-12 01:52 tty10

crw------- root root 4, 11 2013-12-12 01:52 tty11

crw------- root root 4, 12 2013-12-12 01:52 tty12

crw------- root root 4, 13 2013-12-12 01:52 tty13

crw------- root root 4, 14 2013-12-12 01:52 tty14

crw------- root root 4, 15 2013-12-12 01:52 tty15

crw------- root root 4, 16 2013-12-12 01:52 tty16

crw------- root root 4, 17 2013-12-12 01:52 tty17

crw------- root root 4, 18 2013-12-12 01:52 tty18

crw------- root root 4, 19 2013-12-12 01:52 tty19

crw------- root root 4, 2 2013-12-12 01:52 tty2

crw------- root root 4, 20 2013-12-12 01:52 tty20

crw------- root root 4, 21 2013-12-12 01:52 tty21

crw------- root root 4, 22 2013-12-12 01:52 tty22

crw------- root root 4, 23 2013-12-12 01:52 tty23

crw------- root root 4, 24 2013-12-12 01:52 tty24

crw------- root root 4, 25 2013-12-12 01:52 tty25

crw------- root root 4, 26 2013-12-12 01:52 tty26

crw------- root root 4, 27 2013-12-12 01:52 tty27

crw------- root root 4, 28 2013-12-12 01:52 tty28

crw------- root root 4, 29 2013-12-12 01:52 tty29

crw------- root root 4, 3 2013-12-12 01:52 tty3

crw------- root root 4, 30 2013-12-12 01:52 tty30

crw------- root root 4, 31 2013-12-12 01:52 tty31

crw------- root root 4, 32 2013-12-12 01:52 tty32

crw------- root root 4, 33 2013-12-12 01:52 tty33

crw------- root root 4, 34 2013-12-12 01:52 tty34

crw------- root root 4, 35 2013-12-12 01:52 tty35

crw------- root root 4, 36 2013-12-12 01:52 tty36

crw------- root root 4, 37 2013-12-12 01:52 tty37

crw------- root root 4, 38 2013-12-12 01:52 tty38

crw------- root root 4, 39 2013-12-12 01:52 tty39

crw------- root root 4, 4 2013-12-12 01:52 tty4

crw------- root root 4, 40 2013-12-12 01:52 tty40

crw------- root root 4, 41 2013-12-12 01:52 tty41

crw------- root root 4, 42 2013-12-12 01:52 tty42

crw------- root root 4, 43 2013-12-12 01:52 tty43

crw------- root root 4, 44 2013-12-12 01:52 tty44

crw------- root root 4, 45 2013-12-12 01:52 tty45

crw------- root root 4, 46 2013-12-12 01:52 tty46

crw------- root root 4, 47 2013-12-12 01:52 tty47

crw------- root root 4, 48 2013-12-12 01:52 tty48

crw------- root root 4, 49 2013-12-12 01:52 tty49

crw------- root root 4, 5 2013-12-12 01:52 tty5

crw------- root root 4, 50 2013-12-12 01:52 tty50

crw------- root root 4, 51 2013-12-12 01:52 tty51

crw------- root root 4, 52 2013-12-12 01:52 tty52

crw------- root root 4, 53 2013-12-12 01:52 tty53

crw------- root root 4, 54 2013-12-12 01:52 tty54

crw------- root root 4, 55 2013-12-12 01:52 tty55

crw------- root root 4, 56 2013-12-12 01:52 tty56

crw------- root root 4, 57 2013-12-12 01:52 tty57

crw------- root root 4, 58 2013-12-12 01:52 tty58

crw------- root root 4, 59 2013-12-12 01:52 tty59

crw------- root root 4, 6 2013-12-12 01:52 tty6

crw------- root root 4, 60 2013-12-12 01:52 tty60

crw------- root root 4, 61 2013-12-12 01:52 tty61

crw------- root root 4, 62 2013-12-12 01:52 tty62

crw------- root root 4, 63 2013-12-12 01:52 tty63

crw------- root root 4, 7 2013-12-12 01:52 tty7

crw------- root root 4, 8 2013-12-12 01:52 tty8

crw------- root root 4, 9 2013-12-12 01:52 tty9

crw-rw---- system system 241, 0 2013-12-12 01:52 ttyGS0

crw-rw---- bluetooth bluetooth 247, 0 2013-12-12 01:53 ttyHS0

crw------- root root 246, 0 2013-12-12 01:53 ttyHSL0

crw------- gps gps 248, 10 2013-12-12 01:52 ttyMSM10

crw-rw---- system vpn 10, 200 2013-12-12 01:52 tun

crw-rw---- system bluetooth 10, 223 2013-12-12 01:52 uinput

crw-rw-rw- root root 1, 9 2013-12-12 01:52 urandom

crw-rw---- root usb 10, 83 2013-12-12 01:52 usb_accessory

crw-rw---- system system 10, 84 2013-12-12 01:52 usb_mtp_gadget

crw-rw---- system camera 81, 5 2013-12-12 01:52 v4l-subdev0

crw-rw---- system camera 81, 6 2013-12-12 01:52 v4l-subdev1

crw-rw---- system camera 81, 7 2013-12-12 01:52 v4l-subdev2

crw-rw---- system camera 81, 8 2013-12-12 01:52 v4l-subdev3

crw-rw---- system camera 81, 9 2013-12-12 01:52 v4l-subdev4

crw------- root root 7, 0 2013-12-12 01:52 vcs

crw------- root root 7, 1 2013-12-12 01:52 vcs1

crw------- root root 7, 128 2013-12-12 01:52 vcsa

crw------- root root 7, 129 2013-12-12 01:52 vcsa1

crw-rw---- system camera 81, 1 2013-12-12 01:52 video0

crw-rw---- system camera 81, 2 2013-12-12 01:52 video1

crw-rw---- system camera 81, 0 2013-12-12 01:52 video100

crw-rw---- system camera 81, 3 2013-12-12 01:52 video2

crw-rw---- system camera 81, 4 2013-12-12 01:52 video3

crw-r--r-- root root 10, 73 2013-12-12 01:52 xt_qtaguid

crw-rw-rw- root root 1, 5 2013-12-12 01:52 zero

Now let us discuss in details about the line with Red font i.e. drwxr-xr-x root root 2013-12-12 01:52 adsp

Consider the leftmost column of information in to be a table of rows and columns. Each row refers to the file on the right and the columns contain information about that file.

So, the first column consists of 10 characters.

Observe the Permissions.pdf file.

Now,

User is the owner of the file.

Group means all the users who are in the same group as the file's owner.

Others means all the other users on the device.

On an Android device, the important permission columns are those for User and Others, You will need to change the permission levels of some scripts and binary files you add to an un-hacked device.

In details we can say that any user who wishes to access a file belongs to one of the FOUR user classes.

By default, the user who creates a file is the file's owner.

Since most user belong to groups, the file also belongs to the user's group. Member of the group are, in turn, group owners.

Two other user types are implied: others (any user who neither the owner nor a member of the owner's group) and ALL (all users, including the owner, other members of the owner' group, and others.