linux + why I cant change the passwd

0

I have redhat 6.x version

I am trying to change the passwd from single user mode but I get the following

passwd root
changing password for user root
passwd: permission denied 

then I try to verify filesystem is mounted in read/write

 mount -o remount,rw /

but I get permission denied again when typing passswd root

please help me to understand why I get permission denied from single user mode?

yael

Posted 2016-04-14T05:03:56.373

Reputation: 9

Answers

0

Have you checked your /etc/passwd and /etc/shadow files?

grep root /etc/passwd /etc/shadow

Have you attempted editing /etc/shadow (with nano or vim)? You can manually remove root's password, and save.

Ziggy Crueltyfree Zeitgeister

Posted 2016-04-14T05:03:56.373

Reputation: 293

0

Edit the kernel booting options, change ro init=/sysroot/bin/sh to rw init=/sysroot/bin/sh and boot CentOS. When logged in, follow these commands:

chroot /sysroot
passwd root
touch /.autorelabel
reboot

You now should be able to loggin as root user.

Source

sysfiend

Posted 2016-04-14T05:03:56.373

Reputation: 417