If you are a linux user you can use PAM to give such permissions