LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 08-22-2006, 01:59 PM   #1
cmarnell
LQ Newbie
 
Registered: Aug 2005
Location: Boston, MA
Posts: 14

Rep: Reputation: 0
Problem logging on as root through terminal


Hopefully someone can help me with this one.

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.

Thanks for the help.
Cody
 
Old 08-22-2006, 02:40 PM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
You need to make this user account a sudoer.
 
Old 08-22-2006, 02:43 PM   #3
cmarnell
LQ Newbie
 
Registered: Aug 2005
Location: Boston, MA
Posts: 14

Original Poster
Rep: Reputation: 0
I can give that a try later.

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.

Also, I am using CentOS 4.x

Last edited by cmarnell; 08-22-2006 at 02:44 PM.
 
Old 08-22-2006, 03:28 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
When you are logged in as <user>, and type "su", it wants the root password. It is not relevant whether <user> is a sudoer.

Can you log-in as root to the GUI?
 
Old 08-22-2006, 03:33 PM   #5
cmarnell
LQ Newbie
 
Registered: Aug 2005
Location: Boston, MA
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany
Can you log-in as root to the GUI?
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
 
Old 08-22-2006, 04:02 PM   #6
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
Quote:
Originally Posted by pixellany
When you are logged in as <user>, and type "su", it wants the root password. It is not relevant whether <user> is a sudoer.

Can you log-in as root to the GUI?
You cannot become the superuser, hence su, of another user unless you are the root account or you are a sudoer.
 
Old 08-22-2006, 07:43 PM   #7
cmarnell
LQ Newbie
 
Registered: Aug 2005
Location: Boston, MA
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ramram29
You cannot become the superuser, hence su, of another user unless you are the root account or you are a sudoer.
Why would this all of a sudden happen? It worked fine when I first installed the OS and then all of a sudden, one day it didn't work anymore.
 
Old 08-23-2006, 08:40 AM   #8
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
Maybe it's because you where logged in as root and now you are logged is as a non-sudoer user.
 
Old 08-23-2006, 09:04 AM   #9
joaoPinto
LQ Newbie
 
Registered: Aug 2006
Posts: 4

Rep: Reputation: 0
Hello .

i am having a similar problem. How can I make a specific user sudoer?

Thanks for the help

J
 
Old 08-23-2006, 09:08 AM   #10
cmarnell
LQ Newbie
 
Registered: Aug 2005
Location: Boston, MA
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ramram29
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.

Last edited by cmarnell; 08-23-2006 at 04:18 PM.
 
Old 08-23-2006, 04:23 PM   #11
cmarnell
LQ Newbie
 
Registered: Aug 2005
Location: Boston, MA
Posts: 14

Original Poster
Rep: Reputation: 0
Anyone have any other opinions on this problem?
 
Old 08-25-2006, 11:08 AM   #12
cmarnell
LQ Newbie
 
Registered: Aug 2005
Location: Boston, MA
Posts: 14

Original Poster
Rep: Reputation: 0
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
 
Old 08-25-2006, 11:24 AM   #13
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Quote:
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.
 
Old 08-25-2006, 11:33 AM   #14
cmarnell
LQ Newbie
 
Registered: Aug 2005
Location: Boston, MA
Posts: 14

Original Poster
Rep: Reputation: 0
timmeke, thanks for the response.

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

account required /lib/security/$ISA/pam_unix.so
account sufficient /lib/security/$ISA/pam_succeed_if.so uid < 100 quiet
account required /lib/security/$ISA/pam_permit.so

password requisite /lib/security/$ISA/pam_cracklib.so retry=3
password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password required /lib/security/$ISA/pam_deny.so

session required /lib/security/$ISA/pam_limits.so
session required /lib/security/$ISA/pam_unix.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.
 
Old 08-25-2006, 01:54 PM   #15
shadowfx78
Member
 
Registered: Jun 2006
Distribution: Kubuntu, Xubuntu, Ubuntu
Posts: 60

Rep: Reputation: 15
to do something as root try sudo not just su

ie sudo apt-get update
 
  


Reply

Tags
login


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging on as root from The Terminal bobbasic2002 Linux - General 3 03-16-2014 07:44 PM
logging into the root in terminal MrSako Linux - Newbie 3 06-22-2006 04:14 AM
Problem in text based terminal when logging as root MSafty SUSE / openSUSE 3 08-22-2005 04:14 PM
Problem in text based terminal when logging as root MSafty Linux - Software 2 08-17-2005 12:09 AM
problem logging in as root apant Linux - Newbie 3 07-03-2005 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration