Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to set the root password on Amazon EC2 (CentOS machine). When I try passwd, I get this:

[root@domU-11-33-39-00-85-21 ~]# passwd
Changing password for user root.
passwd: Authentication token manipulation error

What can I do to fix this? I know ssh is better but I need to set the password because I require it to login to my webmin.

Contents of /etc/nsswitch.conf:

passwd:     files
shadow:     files
group:      files

#hosts:     db files nisplus nis dns
hosts:      files dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

netgroup:   nisplus

publickey:  nisplus

automount:  files nisplus
aliases:    files nisplus

When I tried passwd -d root and then passwd, I got to reset the password but I can't login using this password.

share|improve this question
    
Could you please add a content of /etc/nsswitch.conf from that system. –  Alex Feb 8 '11 at 15:42
    
Permissions on /etc/passwd and /etc/shadow are ok? Anything in /var/log/messages or /var/log/secure ? Any selinux audit errors? PAM configuration ok (/etc/pam.d) ? If possible set the root pw to a 20-character random string and do root via sudo, all auth via ssh public keys. (don't know if webmin can do this) –  AndreasM Jul 12 '11 at 6:31

1 Answer 1

up vote 2 down vote accepted

To change root password of you CentOS in EC2 with webmin installed in it use the following command after login with your ssh.

/usr/libexec/webmin/changepass.pl /etc/webmin root <yourpassword>

after changing the password you can login with new root password in webmin ofcourse you can nomally login with your ssh and private keys as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.