LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Prevent account from being locked out after X number of attempts (https://www.linuxquestions.org/questions/linux-newbie-8/prevent-account-from-being-locked-out-after-x-number-of-attempts-4175544568/)

jobart08 06-05-2015 05:24 AM

Prevent account from being locked out after X number of attempts
 
Hi all,

I have several crontab entries run as oracle user. I need to prevent oracle user from being locked when the max failed login is reached. Is there a way to prevent it from being locked even when the server is hardened? OS is SunOs.

Thanks!

JeremyBoden 06-05-2015 11:04 AM

crontab entries run as background jobs & do not require any passwords.

joec@home 06-05-2015 12:37 PM

Are you getting an error that a user account actually is being locked, or is this a theoretical question?

jobart08 06-05-2015 06:07 PM

Problem is when oracle users forget the password and by accident, they lock the accounts. The cronjobs wont run because the oracle account is locked. I want to prevent that feom happening. Thanks! :-)

joec@home 06-05-2015 06:14 PM

I'm not specifically an Oracle guru, but you will need to have that configured in the Oracle configuration, not the Linux user configuration.

Configuring Authentication - Subsection Table 3-1 Password-Specific Settings in the Default Profile
https://docs.oracle.com/database/121...n.htm#CHDEGBEG

jobart08 06-05-2015 06:18 PM

My bad. I might have worded it wrong. I meant "oracle" account users in SunOs. Account name is oracle.

joec@home 06-05-2015 06:32 PM

If I remember right SunOS is not too terribly different and should use PAM authentication. Try the following command to try to trace down the specific configuration file causing the lockout.

grep 'deny=' /etc/pam.d/*

You would see something like 'deny=5', more details found in the following article.

How to lock users after 5 unsuccessful login tries?
http://unix.stackexchange.com/questi...ul-login-tries

jobart08 06-05-2015 06:36 PM

But wont that affect every other user account? Is there a way to keep that setting but still make a specific account unlockable? Thanks!

joec@home 06-05-2015 06:52 PM

Quote:

Originally Posted by jobart08 (Post 5372831)
But wont that affect every other user account? Is there a way to keep that setting but still make a specific account unlockable? Thanks!

Short answer, "No" that is only a global setting, not an individual user setting. If there was an option it would be a file like /home/oracle/.pam but that would just be a huge gaping security hole, so it is more fantasy I am saying that reality. At best you might make a script that greps oracle from /etc/passwd and searches for the "!" flag in that line. Then an if true statement to trigger a passwd -u oracle command. Then set that script in the root cron to run every few minutes.

jobart08 06-05-2015 06:54 PM

Great. Thanks man!

jobart08 06-14-2015 08:46 PM

So here are the requirements:

oracle account does not lock after x number of failed logins

oracle account cannot ssh directly - done

sudoers cannot su to oracle account - done


Im having difficulty with the first requirement. Any suggestions?

Thanks!

JeremyBoden 06-15-2015 11:22 AM

How about setting the account so it locks after 9,999,999 failed attempts? :D

jobart08 06-16-2015 01:18 AM

Quote:

Originally Posted by JeremyBoden (Post 5377483)
How about setting the account so it locks after 9,999,999 failed attempts? :D

Hi. Is it possible to set this for just one account?

Thanks!

descendant_command 06-16-2015 01:31 AM

Probably you should be using differnt users for your cron jobs and interactive logins.

chrism01 06-17-2015 05:34 AM

Quote:

Probably you should be using differnt users for your cron jobs and interactive logins.
Now there's a good idea; not only would it solve your problem, but it would enable post-facto audits to distinguish between cron jobs and user access.
In any case, real users should have individual accts anyway (ask your auditor...)


All times are GMT -5. The time now is 10:22 PM.