The command to change the password in shell prompt is:
# passwd
However, to you do it with ssh, you will need your password to access/login it.
If you can't get in, you will need to have phisical accesso to your server, and put your server in rescue mode, starting it with a CD/DVD/pen-drive, to you can change your root password.
Regards,
Netino