Can't change root password

I ssh into the box with the following command:

ssh root@10.0.0.145

with the password: giveit2me

I then type:

passwd

I type in my new password and then confirm it.

I logout and try to login with my new password. Doesn’t work, but ‘giveit2me’ works. What am I doing wrong?