We have installed Redhat Linux 6.5 from scratch the VIA kick start installation and booted into single user mode because I don't have the root password.
But when I perform the following:
passwd root
changing password for user root
passwd: permission denied
Please advice what are the reasons that I get permission denied and how to resolve the problem.
you are in single user mode so you don't specify users
make sure your root filesystem is mounted in read/write
then
this feels like an selinux issue with the files related to passwd. If something has changed the passwd files when selinux was not active it can have the wrong labels and selinux will deny access to the file. (You can probably confirm if selinux is on by examining the kickstart file)
Follow the instructions from here to boot into rescue mode.
After you gain access to the rescue enviroment perform the following instructions to force selinux to relabel the filesystem at next boot
Another approach: If you can boot into single user mode u can check if selinux is running.
this will can either say enforcing, permissive or disabled. You can then decide to disable it while you repair the damage. If you need to turn it off follow these instructions
Look for the line that says
SELINUX=ENFORCING
and replaceENFORCING
withDISABLED
. After that save/exit the file and reboot. If selinux was the culprit you should be able to login like normal.