Root account - disable expiry


 
Thread Tools Search this Thread
Operating Systems Solaris Root account - disable expiry
# 1  
Old 05-25-2008
Root account - disable expiry

I couldnt find this in any other post - so hoping someone can help out.

I want to set password expiry (or rather I have to) for a number of users on my solaris 9 system. I know i can set the following options in the /etc/default/passwd file to do it and then just type a passwd -f <username> to force the user to change password next login and therefore get the new settings...
MAXWEEKS=8
PASSLENGTH=8
WARNWEEKS=1
HISTORY=5


But... I want to exclude some users from password expiry - such as the root user and a few other user accounts...
Some of these accounts are vital for access and also have some vital cron jobs running so I would never want someone to go on holiday for weeks and the account to expire and cause a service issue etc...

Can I do this and if so how?
# 2  
Old 05-25-2008
use `passwd -x -1 username` for root and any other accounts that do not need password expiration.

from `man passwd`
Code:
 -x max        Sets maximum field for name. The  max  field
                  contains  the  number of days that the pass-
                  word is valid for name. The aging for nameis
                  turned off immediately if max is set to -1.

Quote:
Originally Posted by frustrated1
I couldnt find this in any other post - so hoping someone can help out.

I want to set password expiry (or rather I have to) for a number of users on my solaris 9 system. I know i can set the following options in the /etc/default/passwd file to do it and then just type a passwd -f <username> to force the user to change password next login and therefore get the new settings...
MAXWEEKS=8
PASSLENGTH=8
WARNWEEKS=1
HISTORY=5


But... I want to exclude some users from password expiry - such as the root user and a few other user accounts...
Some of these accounts are vital for access and also have some vital cron jobs running so I would never want someone to go on holiday for weeks and the account to expire and cause a service issue etc...

Can I do this and if so how?
# 3  
Old 05-26-2008
This works but is only temporary it seems...
ie. for root user

# cat /etc/shadow | grep root
root:39puDXN0kwb.A:14024::56:7:::

# passwd -x -1 root
passwd: password information changed for root

# cat /etc/shadow | grep root
root:39puDXN0kwb.A:14024::::::


If I then log in as root and decide its time to update the password and change it as below - then expiry settings are re-enabled... if the person who changes root password isnt aware of this - then the account will expire at some stage...

-bash-3.00# passwd
passwd: Changing password for root
New Password:
Re-enter new Password:
passwd: password successfully changed for root
-bash-3.00# cat /etc/shadow | grep root
root:rJHLs0/lIsnEE:14025::56:7:::


Is there anyway to avoid this happening? Smilie
# 4  
Old 05-26-2008
Quote:
Originally Posted by frustrated1
...Is there anyway to avoid this happening? Smilie

No, of course not- that's the whole idea of /etc/default/passwd, it sets the default rules for everyone's passwords. You cannot have it both ways. I gave you the method with the least work- you will still have to override the passwd settings of each user that is to not have an expiring password.
# 5  
Old 05-26-2008
Thanks.. hope I didnt seem ungrateful for your advice..

As its the root user - what do you normally do?
If the expiry is set on the root account and someone changes the password without knowing they have just activated the expiry settings also..

My problem is that the root account is not used v.often - only in the event a system reboot is required etc - a few times a year at most... So its very possible that someone will change the password (security reasons only) and not log in again as root user for 4-5 months.. by this time the account could have expired..

Will the root account be locked or will the user still be allowed/prompted to change password?


ie. my default passwd file contains the following:
MAXWEEKS=8
PASSLENGTH=8
WARNWEEKS=1
HISTORY=5


If someone change password - in 56 days the password will expire with 7 days warning. If no-one has logged in as root in those 7 days - what happens? is the account then expired and cannot be used at all?
# 6  
Old 05-26-2008
Well I don't use password expiration, I use RSA tokens. Smilie

Create a job in root's crontab to run the override for root's account once a month. That should be enough to keep root's account unlocked forever.

Quote:
Originally Posted by frustrated1
Thanks.. hope I didnt seem ungrateful for your advice..

As its the root user - what do you normally do?
If the expiry is set on the root account and someone changes the password without knowing they have just activated the expiry settings also..

My problem is that the root account is not used v.often - only in the event a system reboot is required etc - a few times a year at most... So its very possible that someone will change the password (security reasons only) and not log in again as root user for 4-5 months.. by this time the account could have expired..

Will the root account be locked or will the user still be allowed/prompted to change password?


ie. my default passwd file contains the following:
MAXWEEKS=8
PASSLENGTH=8
WARNWEEKS=1
HISTORY=5


If someone change password - in 56 days the password will expire with 7 days warning. If no-one has logged in as root in those 7 days - what happens? is the account then expired and cannot be used at all?
# 7  
Old 05-26-2008
Or you could use a script like I did and run it from cron.
This is the script that I wrote.
https://www.unix.com/302100435-post4.html
Tornado
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Root password expiry script

Hi Guys In red hat linux server is there a way to alert via email when the root password is about to expire ? As per security policy in our environment root password will expire in 90 days. Example : It would be better if we receive a email on 7th november stating that the root password... (1 Reply)
Discussion started by: newtoaixos
1 Replies

2. Solaris

expiry date of an account

can an user see the expiry date of its own account,also can the user know whether it is having peer access or not. Thanks, Megh (2 Replies)
Discussion started by: megh
2 Replies

3. Solaris

how to su - from non root acount to non root account

HI i am trying to give su access to some users say X Y and Z to a account AB . I am able to give them su access to root with the help of sudoers file but i want to give them password less access to AB account which i am not able to do . I want to this when user X fires "su - AB" he is not... (9 Replies)
Discussion started by: rishiraaz
9 Replies

4. Solaris

disable password expiry

Hi How do i disable password expiration on ldap? It runs on Solaris 10 machine. Thanks in advance. (3 Replies)
Discussion started by: hrist
3 Replies

5. SuSE

Disable the password expiry date

Hi, We are going to create the new user, using that user we are automate the work, but every 90 days password get expired how can i create or avoid the expiry the password. (1 Reply)
Discussion started by: kingganesh04
1 Replies

6. UNIX for Dummies Questions & Answers

Disable root for AIX 5.2

I am able to disable direct root login through telnet. But when I add the rlogin = false into the /etc/security/user file. I am unable to log in as root from ssh. I uncommented the "PermitRootLogin yes" in the sshd_config file. Still can't log in. Can anyone help? (0 Replies)
Discussion started by: james0125
0 Replies

7. AIX

Can't login root account due to can't find root shell

Hi, yesterday, I changed root's shell in /etc/passwd, cause a mistake then I can not log in root account (can't find correct shell). I attempted to log in single-mode, however, it prompted for single-mode's password then I type root's password but still can not log in. I'm using AIX 5L version 5.2... (2 Replies)
Discussion started by: neikel
2 Replies

8. HP-UX

Temporarily Disable User Account

I want to temporarily disable a user account on HP-UX at the start of a script and renable the account at the end of the script. What would be the best method on HP-UX to temporarily disable a user account? I know of the passwd -l option that will lock the account, but I do not see a flag for... (4 Replies)
Discussion started by: scotbuff
4 Replies

9. UNIX for Dummies Questions & Answers

delete or disable the system generated account

I have this unix version 3.0 "UNIX_SV server 4.0 3.0 3425 Pentium II(TM)-ISA/PCI" can i delete or disable the system generated account as "daemon";"uucp";"sys";"adm";"listen";"bin" and if yes how can i do it? Regards (1 Reply)
Discussion started by: sak900354
1 Replies

10. UNIX for Dummies Questions & Answers

Disable Root Console login

After Configuring a brand new netraT1, It appears, the only way you can log in as root is throught the Serial Port (console). I believe there is a file in /etc which can be edited to allow root to access login via other methods eg: telnet, ssh, etc. My Question: Which file contains... (2 Replies)
Discussion started by: SmartJuniorUnix
2 Replies
Login or Register to Ask a Question