CentOS 6 Password

ws11
ws11 used Ask the Experts™
on
I have a server with CentOS 6 and the password needs to be reset.  I have tried to use passwd but I get avc: denied { read } message.  I don't know very much at all regarding linux so I am struggling with what to do.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Top Expert 2013

Commented:
Hi,

you are in runlevel 1 (Single User) and you have SELinux enabled, right?

If so, you've hit a SELinux bug which prevents "passwd" from running in Single User mode when SELinux is enabled.

The only workaround that I'm aware of is adding "selinux=off" to the GRUB kernel boot parameter line, just like you added the "S" for Single User mode.

Besides that, you should upgrade to selinux-policy-3.7.19-58.el6 or later, to prevent this in the future.
Commented:
Actually you add enforcing=0 to the end of the line.  But that did not help with the login.  It still says that is the wrong login information.  So the username must be wroing.  I tried passwd name and it returned Unknown user name.
Most Valuable Expert 2013
Top Expert 2013

Commented:
grep username /etc/passwd

?
How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Author

Commented:
Sorry not following you.  I was using the host name as the username so I assume that is the problem.
Most Valuable Expert 2013
Top Expert 2013

Commented:
I assume so as well ...
Commented:
ok so you have to do the following to change the password for the specific user

passwd your_user_name

then you create a new password for the specified user name
Most Valuable Expert 2013
Top Expert 2013
Commented:
That's it!

Please be aware that you must be "root" to change another user's password, or use "sudo passwd ..." (if you're allowed to do so, that is).

You will be asked twice for the new password, and the user in question must change the newly set password at their first login.

Good luck!

Author

Commented:
It did not appear to need all that but I only have logged in once.  There was no request to change the password.  At this time everything is working fine.
Most Valuable Expert 2013
Top Expert 2013

Commented:
Congrats!

Author

Commented:
It worked for me and the other suggestions did not directly relate but did help.  All points are given to the other person.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial