LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Lock user through file... (https://www.linuxquestions.org/questions/linux-newbie-8/lock-user-through-file-721469/)

kapilbajpai88 04-24-2009 02:45 PM

Lock user through file...
 
Hi Everyone,

I have a small question regarding local user, how to lock a user by using a file, and not any direct command ?
Any direct command will also be appreciated?

Thank You,
Kapil

SlowCoder 04-24-2009 02:58 PM

Lock them from what? Files/binaries, account?

TB0ne 04-24-2009 03:37 PM

Quote:

Originally Posted by kapilbajpai88 (Post 3519894)
Hi Everyone,

I have a small question regarding local user, how to lock a user by using a file, and not any direct command ?
Any direct command will also be appreciated?

Thank You,
Kapil

Your question is not very clear. Lock what, how??

If you mean lock the account, look at the man page for the passwd command, specifically the "-l" option.

kapilbajpai88 04-24-2009 04:14 PM

Quote:

Originally Posted by TB0ne (Post 3519938)
Your question is not very clear. Lock what, how??

If you mean lock the account, look at the man page for the passwd command, specifically the "-l" option.

Hi There,
lock them in the sense that they can't login at any terminal

kapilbajpai88 04-24-2009 04:15 PM

Quote:

Originally Posted by TB0ne (Post 3519938)
Your question is not very clear. Lock what, how??

If you mean lock the account, look at the man page for the passwd command, specifically the "-l" option.


Hi There,
I want to lock them in the sense that they can't login at any terminal, also i want to put timeout for releasing this restriction as well after 10 hrs???

Thank You

anomie 04-24-2009 04:35 PM

As already mentioned:
# passwd -l <user>

To unlock in 10 hours:
# echo '/usr/bin/passwd -u <user>' | at now + 10 hours

kapilbajpai88 04-24-2009 04:46 PM

Quote:

Originally Posted by anomie (Post 3519984)
As already mentioned:
# passwd -l <user>

To unlock in 10 hours:
# echo '/usr/bin/passwd -u <user>' | at now + 10 hours

Hi Anomie,

Thank You for the help...I will try this and update the thread soon


All times are GMT -5. The time now is 05:24 AM.