I want all directories and files to inherit same permissions as parent directory.
You can achieve that with ACLs, check this answer for an introduction: https://unix.stackexchange.com/a/12847/130303
You'll probably need default ACLs to achieve what you want to do. Lets say you have a directory test (with files and dirs already in it) and you want user and group to be able to write and others only to read, you can set default ACLs (recursively) with the first three commands and then set it for the existing files in the other three commands:
setfacl -R -m d:u::rwx test setfacl -R -m d:g::rwx test setfacl -R -m d:o::rx test setfacl -R -m u::rwx test setfacl -R -m g::rwx test setfacl -R -m o::rx test
You can check the ACLs with the command
$ getfacl test # file: test # owner: youruser # group: yourgroup user::rwx group::rwx other::r-x default:user::rwx default:group::rwx default:other::r-x