So, i created a very simple bash script which uses passwd command to disable an account and set the time the script is to be executed by cron. Here's the simple script:
#!/bin/bashlet's say i name it lock.sh. All i need now is to set this script as executable and then add the time to crontab and it will be executed at the time defined.
/usr/bin/passwd username -l
Basically this command will add a character "!" to the shadow file so that user will not be able to login (because the password will be incorrect) and it's easy to solve my problem. If i need to reinstate that username again, i can just issue /usr/bin/passwd username -u and voila.... it will be able to login again.
hiii... my name is harry. i'm a newbie.. it's really nice to have a personal blog so i can share many things to other
ReplyDelete