Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am having a problem logging on as root through a terminal. I have no problems logging on as root through the console though. Whenever I try to log in I get an incorrect password error.
[user@localhost ~]$ su -
Password:
su: incorrect password
I have tried logging on through the console and then opening up a terminal and that didn't work either.
[root@localhost ~]$ su - user
[user@localhost ~]$ su -
Password:
su: incorrect password
I haven't specificall removed access to this, so I am not sure what else to try.
One thing I should have mentioned before is that this was working fine for a few weeks and then suddenly stopped working one day. I can't think if anything I had done before it stopped working.
I can.
After loggining in through the GUI, I still can not get the following to work in a terminal window.
[root@localhost ~]$ su - user
[user@localhost ~]$ su -
Password:
su: incorrect password
Maybe it's because you where logged in as root and now you are logged is as a non-sudoer user.
I was definately not logged in as root. I am logged on as user through the terminal and I had been connecting through ssh remotely and from my LAN. I was also previously able to log into a virtual terminal from the console while being logged into the console as user.
This is the third or fourth time I have installed Linux (always a Red Hat distro) and have never had to do any extra to being able to change to root.
So I am 100% sure it is not a problem with me being in sudoers.
Here is the problem, the password is definately correct.
[user@localhost ~]$ su -
Password:
su: incorrect password
I get the following error in /var/log/messages after my su - attempt fails.
Aug 25 11:07:48 localhost su[31927]: Warning! Could not relabel /dev/pts/2 with user_ubject_r:initrc_devpts_t, not relabeling.Operation not permitted
Aug 25 11:07:52 localhost su(pam_unix)[31954]: authentication failure; logname=root uid=500 euid=500 tty=pts/2 ruser=user rhost= user=root
You cannot become the superuser, hence su, of another user unless you are the root account or you are a sudoer.
??
"su" stands for "switch user", not "superuser".
'su' and 'su -' (switch to 'root' user) work only if you have the root password.
'su user' and 'su - user' only work if you have the user's password or if you're already root (root doesn't need to supply the user's password).
Judging from the posted message, it seems that the PAM authentication module is blocking your su attempt. This can be due to just 2 things:
1. a faulty PAM configuration;
2. supplying the wrong username/password.
As for the 1st possibility, please post the contents of /etc/pam.d/system-auth.
For the second, I'm wondering if you are using any special characters in your password (ie a keyboard lay-out issue or locale issue). Also, you must be sure that:
* if you're a normal user and try to become superuser via 'su' or 'su -' (fully equivalent to 'su root' or 'su - root'), then you need to supply the password for the root user (not your normal user's password);
* if you're root trying to switch to another user via 'su - user', then you shouldn't need to type in any passwords (if you do, I assume PAM config or SELinux is the culprit).
* if you're a normal user and try to 'su - user', then you need to supply the other user's password.
This is the complete contents of /etc/pam.d/system-auth
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required /lib/security/$ISA/pam_env.so
auth sufficient /lib/security/$ISA/pam_unix.so likeauth nullok
auth required /lib/security/$ISA/pam_deny.so
I am logged in as a normal user an I am trying to su - root.
I am 100% sure I have the correct password and there are no special characters in it (I changed it to something simple, when this started happening, to verify that wasn't the problem)
Currently SELinux is enabled but running in permissive mode.
Please let me know if I can provide any more information.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.