# copying users and groups to new machine



## danil75 (Oct 24, 2019)

I building a new BSD Server.
my old Server has 50 users that I want to copy.

There are three files you need to copy from the old to the new server.
/etc/passwd
/etc/group
/etc/master.passwd

copy to the new server
than run on the new server
`pwd_mkdb -p /etc/master.passwd`

does it keep the User id and group id?


----------



## SirDice (Oct 24, 2019)

It does if you copied those files, yes. The UID and GID is stored in those.


----------



## danil75 (Oct 24, 2019)

thank's


----------



## SirDice (Oct 24, 2019)

If you copied those files make sure master.passwd only has 600 permissions. Both passwd and group can have 644 permissions.


----------



## drobison (Oct 28, 2019)

Technically I don't think you need to copy over passwd as the pwd_mkdb command will create it.


----------

