LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-16-2005, 10:33 PM   #1
minil
Member
 
Registered: Dec 2004
Location: Bangalore, India
Distribution: Fedora 2
Posts: 74

Rep: Reputation: 15
How to Block User Login


Hi all,
How to temporirly block a particular user from login.
What is the command ?

Thanks in advance
 
Old 10-16-2005, 10:47 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

'usermod -s /sbin/nologin username' will lock the user out.

'usermod -s /bin/bash username' will let them back in.

Dave
 
Old 10-16-2005, 11:19 PM   #3
minil
Member
 
Registered: Dec 2004
Location: Bangalore, India
Distribution: Fedora 2
Posts: 74

Original Poster
Rep: Reputation: 15
Hi i be able to lock the user. by giving 1'st Command.
but i cant login again after giving the second command for particular user..


Its saying access denied.. whats wrong

Command 1 : $ usermod -s /sbin/nologin aeiou
now account blocked


command 2 : $usermod -s /sbin/bash aeiou

when i try to login after giving 2 nd command it saying access denied...

reply me soon
 
Old 10-16-2005, 11:23 PM   #4
minil
Member
 
Registered: Dec 2004
Location: Bangalore, India
Distribution: Fedora 2
Posts: 74

Original Poster
Rep: Reputation: 15
i found it ...

command 2 : $usermod -s /sbin/bash aeiou
^^^


It is /bin/bash...


Thanks a lot ..
 
Old 12-10-2005, 06:15 AM   #5
namit
Member
 
Registered: Aug 2005
Distribution: Debian
Posts: 355

Rep: Reputation: 30
does this stop them accessing your emails also?

what about just stopping people login using ssh?
 
Old 12-10-2005, 11:49 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Most POP3/IMAP servers allow a user with /sbin/nologin to get their mail (since you don't actually need a login shell to download mail). If you just want to block SSH access but leave console access intact, you can use the DenyUsers directive in /etc/ssh/sshd_config . Note that you must restart sshd after modifying this file.
 
Old 12-19-2005, 09:00 AM   #7
namit
Member
 
Registered: Aug 2005
Distribution: Debian
Posts: 355

Rep: Reputation: 30
I am installed web-min with ssh and it works perfect just bloked everyone except me
 
  


Reply



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
Block a Particular User through FTP service karthi Linux - Security 1 11-07-2005 03:57 PM
Block a Particular User through FTP service karthi Linux - Security 1 11-07-2005 02:23 PM
Block user in PHP aznita Programming 4 06-17-2005 06:49 AM
How can I block net access for 1 user? jimk Linux - Security 10 11-26-2004 11:43 AM
How to block lsmod and su so user can't use those command Ninja_212 Slackware 4 04-18-2004 12:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:59 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
Open Source Consulting | Domain Registration