LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Logged in as root, prompted for root password (https://www.linuxquestions.org/questions/slackware-14/logged-in-as-root-prompted-for-root-password-315607/)

ta0kira 04-21-2005 03:15 AM

Logged in as root, prompted for root password
 
I am running Slackware 10.0, and when I try to install a package with the KDE package installer I get a prompt to log in as root (when ALREADY logged in as root). It isn't the KDE root prompt; it is a small terminal running a shell. I typed 'login' and tried logging in as root, but it says my login is incorrect. Can you tell me what I need to do, and possibly how I messed something up? It used to work, but I don't remember what's happened since the last time I used it. I can 'make' and 'make install' manually with no problems, however. Thanks.
ta0kira

killerbob 04-21-2005 06:23 AM

You can't type "login" to log in when you're already logged in.

Instead, use the substitute user command. "su root". You'll be prompted for the password, and then given a root shell.

ta0kira 04-21-2005 09:53 AM

Thanks, I'll try that. It doesn't see me as logged in however; I've typed 'logout' and it says something like "this is the shell, therefore you can't log out; you need to exit". It also doesn't translate my PS1; it just displays it as I've typed it in.
ta0kira

XavierP 04-21-2005 10:04 AM

If you type in 'whoami' to a console, which user name comes up?

Wartz 04-21-2005 10:17 AM

I'm guessing you logged into KDE as root? try logging into your normal account then installing the package. When the prompt comes up type in your root password and see what happens.

As for logging out of a console, you need to type exit, not logout.

ta0kira 04-22-2005 01:02 AM

Ok, (logged in as root) in the terminal that popped up I did the following;

whoami (gave me 'root')
id -u (gave me '0')
su (nothing)
su root (nothing)
exit (closed window)

So I am root, so I am wondering if "root login" is just the generic title for that terminal, and that there is some other error. It could be that the terminal is only to show the script output, however there is a problem executing the scripts.
ta0kira

killerbob 04-22-2005 06:36 AM

If you're logged in as root, su doesn't prompt for a password.

ta0kira 04-22-2005 07:44 AM

Yes, I am aware of that. That means that something is happening in the package manager that should not be happening.

sinczar 04-22-2005 08:50 AM

Same thing happened to me!!
 
ta0kira, killerbob,

the same thing happened to me yesterday when i tried to run xorgsetup.
I su to root from within a terminal, and got the error message that i needed to be
root before running xorgsetup. from all indications the terminal command line said I
was in root. I even tried to su again but was not prompted for a password, therefore
i must have been in root.

i will try to login as root from a reboot today and see if the problem repeats.

Rich D
Michigan, USA

killerbob 04-22-2005 09:59 AM

sinc, it's a longshot, but were you logged in to console, or were you using an x-term to run xorgconfig?

It's a personal preference, but whenever I do something to my xorg.conf, I change the default runlevel to 3 until I'm sure the change won't break things. Likewise, any changes are done in RL3, and tested with startx.


Likewise, ta0, what program are you trying to install? Is it something whose install depends on X, or can it be installed from console? If so, have you tried switching to RL3 (init 3) to install it? That way you can be 100% sure that you're logged in as root....

kodon 04-22-2005 03:08 PM

umm...just wondering, why are you using the kde package manager?
is there a problem with installpkg or pkgtool?

gbonvehi 04-22-2005 03:25 PM

Re: Same thing happened to me!!
 
Quote:

Originally posted by sinczar
ta0kira, killerbob,

the same thing happened to me yesterday when i tried to run xorgsetup.
I su to root from within a terminal, and got the error message that i needed to be
root before running xorgsetup. from all indications the terminal command line said I
was in root. I even tried to su again but was not prompted for a password, therefore
i must have been in root.

i will try to login as root from a reboot today and see if the problem repeats.

Rich D
Michigan, USA

I've found the root to your problem.
For the people that doesn't know, there's a difference between su and su -, the latest will load the enviroment values for the user you're "suing" to (in that case root).
xorgsetup is actually a bash script that tries to configure X for you using the command X -configure, if you take a look at xorgsetup you will see this lines:
Code:

# If we aren't root, bail:
if [ "$USER" = "root" ]; then
  TMP=/var/log/setup/tmp
else
  echo "Only root can configure X."
  exit
fi

It seems the message you got is "Only root can configure X.". That happens if the USER variable in your enviroment is not root.
Well, if you're in user gbonvehi the enviroment variable USER will have the content gbonvehi. If you su to root, the variable USER is still gbonvehi instead of root, this happens when you don't use su - which loads the user enviroment value, in that case root, so if you use su - instead of su USER will be root which will allow you to use xorgsetup.
I hope you get it, if not, sorry, i'm in hurry :P

PS: If i'm not wrong xorgsetup will load X to "autoconfigure" for you, so I guess it won't run if you're running a X server on display 0 (the default), so, do this from text-mode ;)


sinczar 04-22-2005 06:50 PM

Understood,
 
So the all powerful root humbled by a lowly environmental config file. Thanks for the tip. Problem solved

Rich D.

ta0kira 04-25-2005 01:29 AM

The reason I was using KPackage was so I could easily see what I already have. pkgtool and installpkg work just fine for me, but I don't like the idea of having something broken on my system that I did not directly break.

I think the problem was when I installed kernel 2.6.7 as a package; it overwrote some symlinks, so when I was running 2.4.26 it would look in a 2.6.7 directory. I tried replacing the links to reference the 2.4.26 directories, etc., but I guess it did more than just that. ./configure for Qt projects didn't recognize that it was installed, and also it didn't recognize that kdelibs was installed. Basically my system was jacked. I just did a reinstall, and it works fine now. Only took about 2 hours to get everything configured again. Thanks again.
ta0kira

(Oh, BTW, the root prompt doesn't use a script for KPackage; it is hard coded into a .cpp file; I found it. Don't feel like rewriting it.)


All times are GMT -5. The time now is 07:09 PM.