2

I am migrating from an old Ubuntu 10.04 server to a different machine, upgrading to 14.04 at the same time.

One of my tasks is to migrate the users, so I have exported a list of users with UID > 1000 on the old machine and then appended that list to the list on the new machine

cat userlist >> /etc/passwd

Same for /etc/shadow.

I noticed a few users that were probably not created manually but are the result of the installation of a program. In my case, these users are vmail and spamd.

Now I wonder, whether importing those users before installing the program may cause any issues. Should I

  1. install dovecot and spamassassin first, then import the users, check the result with pwck and delete the duplicate
  2. import the users, then install dovecot and spamassassin as it will reuse the existing user and not cause issues
  3. something completely different
Thomas Weller
  • 4,617
  • 4
  • 24
  • 36

1 Answers1

4

No, it will not cause problems.

Creating users from random software is done with a check where is tested if the user already exists.

And there is a better method for creating users. The command newusers {file} where {file} is in the format

loginname:password:uid:gid:comment:home_dir:shell

(and yes, that is the password file format) will create all the users in that file where existing users are skipped. It will also create the home directories (where yours will not).

See the newusers manpage for some tips and tricks (the password field is something to have a look at though since it wants plain text and not encrypted passwords).

Rinzwind
  • 299,756