LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-22-2009, 03:23 AM   #1
srinivasmiriyalu
Member
 
Registered: Mar 2009
Location: Banglore-India
Distribution: RHEL5.2,Fedora9&11,Opensolaris 5.11,SXDE 1/08,CentOS-5.3,Ubuntu 8.10
Posts: 149

Rep: Reputation: 16
one time password wrong,system goes to shutdown


hi friends
here is my question
In login screen,after entering the username we need to enter password,if password is correct we can log into GUI, if password is wrong,again we need to enter user name and password,But what i want to do is if entered password is wrong at first-attempt,then immediately system goes to shutdown...how can i do this.. anybody have idea
 
Old 06-22-2009, 04:18 AM   #2
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
Sounds like you're creating a Denial of Service vulnerability on yourself... there are controls in place to lock an account after any number of failed attempts - rather than shutting down the whole system and making it unavailable to all accounts/users/clients.

If this is of interest to you, check out /etc/pam.d/system-auth. look for 'deny' and 'unlock_time' parameters to set how many failed login it takes to lock the account and for how long to lock it...
 
Old 06-23-2009, 12:50 AM   #3
srinivasmiriyalu
Member
 
Registered: Mar 2009
Location: Banglore-India
Distribution: RHEL5.2,Fedora9&11,Opensolaris 5.11,SXDE 1/08,CentOS-5.3,Ubuntu 8.10
Posts: 149

Original Poster
Rep: Reputation: 16
one time password wrong,system goes to shutdown

well,Thanks for your reply
but i want to do is shutdown the system if first attempt is wrong
i dont want to lock the user account
do you have any idea
 
Old 06-23-2009, 01:49 AM   #4
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
Found this for you...

Quote:
For the most basic functionality, you could simply edit /etc/pam.d/common-auth and change it to the following:

auth sufficient pam_unix.so nullok_secure
auth required pam_exec.so shutdown -h now

This will cause the system to shutdown after ANY failed password attempt that uses PAM. For more control, you could instead have pam_exec run a custom script that, say for example, uses a counter method (so it only shuts down after 5 failed logins), or you could edit each application's PAM configuration separately. Add the pam_exec line to /etc/pam.d/gnome-screensaver, for instance, to only have it affect the locked screen.
Please reply with an update if this works for you.
 
Old 06-26-2009, 05:44 AM   #5
srinivasmiriyalu
Member
 
Registered: Mar 2009
Location: Banglore-India
Distribution: RHEL5.2,Fedora9&11,Opensolaris 5.11,SXDE 1/08,CentOS-5.3,Ubuntu 8.10
Posts: 149

Original Poster
Rep: Reputation: 16
one time password wrong,system goes to shutdown

thanks Beotch
unfortunately i was unable to locate /etc/pam.d/common-auth btw i am using solaris express developer edition 1/08 do you have any idea about that file..where can i find in my system
 
Old 06-26-2009, 10:59 AM   #6
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
Sorry, I havent used solaris in yearrrrrs.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
System is booting with wrong time stefaandk Linux - General 1 11-21-2006 07:24 PM
System reboots after shutdown after some time cccc828 Slackware 4 05-15-2005 04:16 AM
Setting System Time: kernel in wrong time zone warrenweiss Linux - General 7 05-15-2004 03:25 PM
system time is wrong, how do i change? jjd228 Linux - General 8 02-19-2004 04:12 PM
system time wrong acid_kewpie Linux - General 4 02-23-2002 09:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:48 PM.

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