Hi,
If you are using vi to edit the /etc/passwd and the permissions of the file are the following:
-r--r--r-- 1 root sys 966 Jan 10 15:54 passwd
You need to save your changes using wq! instead of using wq because root doesn't have write permissions on this file, only read.
StickyBit.