Where and how exactly I can set the expiration time of password of users i.e.the time after which the UNIX OS prompts user after giving some warnings that your password will expire with in n days and then expire the user's password?
But you need to use the passwd command with the maxdays and warndays set:
e.g. passwd --maxdays 10 --warndays 5 user
would set the maxdays between password changes as 10, and give 5 days warning.
EDIT: So if you have a list of usernames in a text file one per line then the following might work:
cat usernamelist | while read $a; do passwd --maxdays 10 --warndays 5 $a; done
Maybe you want to take a look at the chage command.
chage -l john Last password change : May 22, 2007 Password expires : never Password inactive : never Account expires : never Minimum number of days between password change : 0 Maximum number of days between password change : 99999 Number of days of warning before password expires : 7