0

so I am writing a program in mainly C/C++, though I think this question fits under server fault as it is related to the Linux distro Ubuntu.

So what I am looking for is a way (possibly hackerish-way) to install Ubuntu 12.04 (or later), BUT without setting username/password upon installation. I know, if you have used Windows Server 2008/2012 with Active Directory that you can specify that users are to change/set password upon next boot-up, though I am unsure as to how this could be done in a Linux environment.

Basically what is the goal here; normal installation (Ubuntu) -> Boot once, tweaking -> next bootup set username/password. All but the last part is done by me and the program that I am making, at ease for the users.

Now I have though about perhaps deleting/modifying files such as passwd, though this would not be sufficient. While a bit off-topic I think this part is also relevant, the program basically sets up files/directories with correct permissions and modifies conf files accordingly.

For Ubuntu 12.X++ (actual OS files being served over TFTP/NFS) then the user should be prompted for a username/password once as if they were doing a clean install of the OS.

Is this at all possible or would I have to set a default username/password and tell users to manually delete/setup their own user/password by themselves? This is what I have done for now, though I would prefer another way to do this.

Other information: this is being done on Ubuntu Server, possibility to chroot and mount filesystems to make changes are possible.

Hopefully nobody misunderstood me, I look forward to answers.

-- Dusz

dusz
  • 155
  • 4

1 Answers1

0

The way I'm doing something similar is:

  • PXE/TFTP to install the base OS (kickstart or preseed according to your OS specific needs)
  • puppet to configure the OS to match my policy
  • LDAP/Kerberos to provide authentication/authorization (I am using freeIPA)
  • When creating an account, the password is set to be renew upon first login (similar to chage -d0 $USER)
  • polyinstantiation of /home and /tmp using pam_namespace(8)

This way, I can provide accounts centrally configured, user's home directories are only created on demand and users are forced to change their passwords on activation of their accounts.

dawud
  • 15,096
  • 3
  • 42
  • 61
  • Not a bad suggestion, though would this be _prompting_ users of program (admins, setting up PXE server) for a username/password for their Ubuntu booting option? My goal is not to massively manage a lot of users, but rather to create a functioning program that serves as a helping finger in the setup. This is why a promt for username/password once (remember my program is serving _hopefully_ a clean install without username/password) so that all the admin has to do is boot once to setup as he wishes. – dusz Apr 22 '13 at 09:50
  • It is not clear if what you want is to password-protect entries in a PXE based menu, if that is the case, check [here](http://www.syslinux.org/wiki/index.php/PXELINUX), there are examples of such a setup – dawud Apr 22 '13 at 10:04