Score:1

Is it possible to migrate a password file from FreeBSD to Linux?

cn flag

Moving from a FreeBSD server to Ubuntu. I copied the /etc/passwd file across with no problems, but hand-copying one of the hashes from /etc/master.passwd (FreeBSD) to /etc/shadow (Linux) didn't seem to work. The hashes certainly seem to be in the same format, but no joy.

Is this possible to do? Did I make a mistake, or is there something I missed?


Edit: I tried again, and hand-copying seems to have worked. I must've made a typo the first time around.

djdomi avatar
za flag
I would suggest that you take a look at LDAP, because it will be using a more elegant authentication imho. moreover take a look at [ask]
Edward Falk avatar
cn flag
You may be right, but it's a small legacy system with only about 50 users, so I'm not sure it's worth the effort. Besides, my goal here is to not make them all do password resets, so switching to LDAP wouldn't help anyway.
A.B avatar
cl flag
A.B
Traditionally the start of the "hash" defines the hash type. Here's a wikipedia entry about it: https://en.wikipedia.org/wiki/Crypt_(C)#Key_derivation_functions_supported_by_crypt
Edward Falk avatar
cn flag
Yes. On the FreeBSD system, my hashed password started with `$6$` while on the Ubuntu system I saw both `$6$` and `$y$`. See my edit above.
Score:1
cn flag

Experimenting shows that both systems use the same format and algorithms for hashes, so you can cut-n-paste the hash field from /etc/master.passwd to /etc/shadow and it works.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.