I'm migrating from one Linux server to another with a very similar configuration. Both have Plesk, which has automatically migrated much of the data. However, there are a number of FTP users created outside of Plesk which I now need to move. I have filtered the old passwd file to just entries that I need to add to the new passwd file.
I find that if I just append the extra users into passwd on the new server, they are not given an entry in shadow, which causes problems later.
What's the best way to get these users into passwd? Once they are imported, I'll set the passwords with chpasswd.
UPDATE I'd like to import not just the usernames, but also the group, home directory, etc.
Why not something simple like using cut/xargs.
Or maybe something more complex like this (not thoroughly tested).
You could do the whole thing in a single command like
awk ... | bash
. Though I strongly suggest you look at the output of awk the first time to make sure everything looks correct.