There are times when you need to prevent a particular bash-enabled user to login temporarily into your system, without completely deleting his account, here's an entry to do that.
This entry can be helpful for a situation wherein you need to temporarily prevent bash-enabled users from logging into the system.
How to temporarily deny a user from logging into a system?
# finger visitor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Login: visitor Name: (null)
Directory: /home/visitor Shell: /bin/bash
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To restrict the above visitor account from logging into the system while you are fixing something related to his website folder or files, simply
# chsh visitor -s /sbin/nologin
As soon as the visitor account logs in, a similar message pops out
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This account is currently not available.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Alternatively, you can lock the account while you are busy at fixing something related to his websites files and folders
# passwd -l visitor
The above prevents visitor account from logging into the system by locking his system account. The only difference is that first approach sends a friendly temporary unavailability message to that particular system user of
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This account is currently not available.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
while the second approach of freezing or locking the user account would send a horrible system message similar to
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Permission denied, please try again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are a lot of ways to prevent a particular user from logging into the system.
Enjoy.
Related Reading:
Disable Any User from Logging into the System
Linux Password, Shadow and Group Files Explained
Categories
- HowTos (608)
- Linux Devices (36)
- Linux Diggs (601)
- Linux News (1488)
- Linux Videos (21)
Recent Posts
- e1000e Bug Squashed — Linux Kernel Patch Released
- MontaVista "Summit" concludes
- Open-source image editing project launches
- Convirt 0.9.5 released
- 5 GIMP Tricks Everyone Should Know!
Blog Archive
-
▼
2008
(2226)
-
▼
October
(65)
- e1000e Bug Squashed — Linux Kernel Patch Rel...
- MontaVista "Summit" concludes
- Open-source image editing project launches
- Convirt 0.9.5 released
- 5 GIMP Tricks Everyone Should Know!
- Playing with ASCII Values in ActionScript 3
- Centralized Backup Server With Amanda On CentOS
- Ubuntu on the beach
- Pidgin instant messaging client: a video tour
- Lindependence: A Low-Key Revolution in Software
- Pidgin Answering Machine - Splert Updated
- Distribution Release: VectorLinux 5.9 "Live&q...
- Apple Denigrates Psystar's Antitrust Claims
- Secure Your Gmail Account With SSL Encryption With...
- In Gimp We Trust
- Integrating APC (Alternative PHP Cache) Into PHP5 ...
- Six Reasons Why Linux Is Right for Small Business
- How Kernel Hackers Boosted the Speed of Desktop Li...
- Red Hat undercuts Microsoft on high-performance OS...
- Five programs you can afford in a financial meltdo...
- Gimp 2.6 out, GEGL still unfinished
- Ubuntu 8.10 Beta released
- Bash Parameter Expansion
- MontaVista Linux drives Dell's quick-boot feature
- Financial crisis may bode well for Linux
- pChart - Powerful Open Source Charting Library
- Ballmer: Microsoft Is Up-Front About Its Money Mot...
- GParted Live 0.3.9-4 Released
- A New Way of Sleeping in the Linux Kernel
- Freedom, software and society
- Development Release: Momonga Linux 5 RC
- Ubuntu Intrepid Ibex hits Beta
- Protect your network with pfSense firewall/router
- Survey: Open source benefits 'outweigh' problems
- In Gimp We Trust
- Reducing Boot Time On a General Linux Distro
- Virtualization design targets wireless base statio...
- Reducing Boot Time On a General Linux Distro
- 451 Group: Open source conference evolution, resta...
- Distribution Release: GParted LiveCD 0.3.9-4
- GIMP 2.6 released
- Free version of Hyper-V now available
- Linux - Is It For You?
- The Usability Problems of useit.com
- GIMP 2.6.0 Released
- Geek Reviews: Monitor And Benchmark Your PC With P...
- Android: Mobile Industry at a Crossroads
- Fedora 9 + Compiz-fusion with Nvidia Beta driver
- Sbopkg provides seamless package repository integr...
- Linux Foundation launches end-user conference
- The State of Bluetooth Headsets
- GNU IceCat 3.0.3 now available
- Open Source Software a Booster Shot for Health Car...
- Fast set up of an Erlang server for your web appli...
- Qt Extended 4.4 released, looks pretty
- The A-Z of Programming Languages: C#
- GNU Toolchain Update: September 2008
- National Free Software Conference, 2008
- Distribution Release: NetSecL 2.3
- So how do you REALLY feel about DRM?
- Nathive: A Free Linux Image Editor
- The Linux Safety Net: Living Fast and Dangerous
- Do we need a LinuxCon?
- New GNOME 2.24 Is An Incremental Improvement
- Microsoft Begins to Reveal Visual Studio 2010
-
▼
October
(65)
Thursday, January 17, 2008
HowTo: Deny User from Logging Into Your System
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy


0 comments:
Post a Comment