No need to change password

Posted on 2005-05-06
Last Modified: 2013-12-27
Hi All,

I am using Sun OS 5.1.

Now some users will prompt to change password every 90days.
Can I run a command to disable this feature. ie. all users will not prompt to change passwd every days and they can still login with the old password.

Question by:ee_lcpaa
    LVL 2

    Accepted Solution

    Yes,  for a given "user":

    # passwd -x -1 user

       will disable password aging for a user, and keep current password intact.

    You should also take a look at the file /etc/defaults/passwd
       and see what the MAXWEEKS=   is set to.
       if it has a value, like MAXWEEKS=12  ,   then remove the value, leaving the value blank, like
       MAXWEEKS=          , and that will disable password aging for everyone.

    LVL 10

    Expert Comment


    >> I am using Sun OS 5.1.

    Really ? That would be Solaris 2.1 which was current back in 1994. I could image you are using SunOS 5.5.1 (around 1997), not 5.1. Can you confirm this ?

    If you are really using 5.1, then I'm not sure if we already had a /etc/shadow-file at that time, and therefore the passwd as proposed by thaanum may not work. In this case, only go for /etc/default/passwd.

    If you are using 5.5.1 you may use the following script to do it on all users:

    while read a b
    passwd -x -1 $a
    done </etc/passwd

    (suppose you are not using NIS or NIS+)

    LVL 48

    Expert Comment

    Solaris 2.x has always had /etc/shadow, however my memory doesn't extend back far enough to remember if the passwd command has the -x feature.  I'm pretty sure this came in later versions of Solaris.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
    FreeBSD on EC2 FreeBSD ( is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now