Suppose you have a folder mine_dir that you want to set as administrator to access read and write.

  • Change folder owner sudo chown root:root mine_dir
  • Recursively set all file permissions under mine_dir to level 700 sudo chmod -r 700 mine_dir

After the above two commands, mine_dir is not accessible to ordinary users.

If you want to access it, you need to change to administrator user sudo su

If you want to switch back to normal user, sudo su normal user name