1

We are looking at providing laptops that pre-installed with Ubuntu and need a way to force the user to set a password during the first bootup.

Is there a standard way to do this?

1 Answer 1

1

You would want to set each users account password to expire sometime in the past.

From Official Ubuntu User Management Documentation:

To easily view the current status of a user account, use the following syntax:

sudo chage -l username

The output below shows interesting facts about the user account, namely that there are no policies applied:

Last password change                                    : Jan 20, 2008
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7

To set any of these values, simply use the following syntax, and follow the interactive prompts:

sudo chage username

The following is also an example of how you can manually change the explicit expiration date (-E) to 01/31/2008, minimum password age (-m) of 5 days, maximum password age (-M) of 90 days, inactivity period (-I) of 5 days after password expiration, and a warning time period (-W) of 14 days before password expiration.

sudo chage -E 01/31/2008 -m 5 -M 90 -I 30 -W 14 username

To verify changes, use the same syntax as mentioned previously:

sudo chage -l username

The output below shows the new policies that have been established for the account:

Last password change                                    : Jan 20, 2008
Password expires                                        : Apr 19, 2008
Password inactive                                       : May 19, 2008
Account expires                                         : Jan 31, 2008
Minimum number of days between password change          : 5
Maximum number of days between password change          : 90
Number of days of warning before password expires       : 14

Other Security Considerations Many applications use alternate authentication mechanisms that can be easily overlooked by even experienced system administrators. Therefore, it is important to understand and control how users authenticate and gain access to services and applications on your server.


Also, check out Automating/Customizing an Ubuntu installation using preseeding. This looks like what you want to be doing.

4
  • That might work if nothing else will. Is there a way to have it configure the username for UID 1000, the timezone and keyboard on the initial boot?
    – user986897
    Oct 10, 2011 at 0:44
  • Sounds like this would be a lot easier for you to do with a custom installation. Check out Automating/Customizing the Ubuntu installation using preseeding.
    – chown
    Oct 10, 2011 at 1:06
  • The idea is to do a custom installer, but it needs to be pre-installed on the hard drive. The goal is to have Ubuntu preinstalled on the harddrive and the first time you turn it on it asks you for your username, password and TZ, etc. The only way pre-seed looks like it will work is if I create an installer partition on the hard drive and have the installer install to all available free space.
    – user986897
    Oct 10, 2011 at 2:52
  • I prefer having a USB based installer but some people want to be able to turn on a new computer and start working quickly.
    – user986897
    Oct 10, 2011 at 2:58

You must log in to answer this question.