I sure hope you've found an answer to this by now, but I think I see the problem. In your 'sed' command, the search string you're using is 'user2: *'. What this matches is 'user2:' followed by any number of spaces. Using your example, the result is that it ADDS 'root' in before the existing data:
$ cat > test.txt
$ sed 's/user2: */user2: root/' test.txt
So, if what you really want to do is replace that entire line, you have to use the "." wildcard. The dot means "Any Single Character". The asterisk doesn't behave like you'd expect it to in regular expressions. It means that the character before it can repeat until infinity and it'll keep matching it.
So in your example, you're matching an infinite number of "spaces" with " *". To match ANY character, not just spaces, you'll want to use the dot.
$ sed 's/user2: .*/user2: root/' test.txt
That should give you the result you're looking for. I hope this helps!