LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-24-2009, 02:45 PM   #1
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Rep: Reputation: 41
Question 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
 
Old 04-24-2009, 02:58 PM   #2
SlowCoder
Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Fedora (Desktop), CentOS (Server), Knoppix (Diags)
Posts: 934

Rep: Reputation: 38
Lock them from what? Files/binaries, account?
 
Old 04-24-2009, 03:37 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,812

Rep: Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191
Quote:
Originally Posted by kapilbajpai88 View Post
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.
 
Old 04-24-2009, 04:14 PM   #4
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Quote:
Originally Posted by TB0ne View Post
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
 
Old 04-24-2009, 04:15 PM   #5
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Quote:
Originally Posted by TB0ne View Post
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
 
Old 04-24-2009, 04:35 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
As already mentioned:
# passwd -l <user>

To unlock in 10 hours:
# echo '/usr/bin/passwd -u <user>' | at now + 10 hours
 
Old 04-24-2009, 04:46 PM   #7
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Cool

Quote:
Originally Posted by anomie View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied gabsik Linux - Server 6 08-30-2012 09:39 PM
Created user in Webmin - how to lock that user in specified directory? guest Linux - Security 1 04-18-2009 07:21 PM
Fedora 8 and NoMachine "Could not create lock file in /tmp/.tX1002-lock" ln3wb13 Linux - Software 3 05-17-2008 01:31 PM
Can't read lock file /tmp/.X0-lock squinn Linux - Newbie 3 07-13-2004 03:42 PM
How to lock user in /home/user herc Linux - Software 3 09-15-2003 11:50 AM


All times are GMT -5. The time now is 09:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration