Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Nov 2005 21:53:02 -0800
From:      Mike Eubanks <mse_software@charter.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Root powerless?
Message-ID:  <1132552382.2267.25.camel@yak.mseubanks.net>
In-Reply-To: <BAY113-F359A373526CE2FEA530F29F3530@phx.gbl>
References:  <BAY113-F359A373526CE2FEA530F29F3530@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2005-11-20 at 20:50 -0800, Brooke Landers wrote:
> >[root@schultz ~]# id
> >uid=0(root) gid=0(wheel) groups=0(wheel), 5(operator)
> >
> >you should have uid=0
> 
> 
> hello Richard. thank you for the help. heres what i get
> 
> srv-0021# id
> uid=0(root) gid=0(wheel) groups=0(wheel), 5(operator)
> 
> /etc/passwd and group look normal too. everything else is running ok.
> 
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


I don't know if it will help, but you might try `su -' to get a full
root login.  There may be a difference in your environment.  Below is my
reasoning.

``su'' issued by unpriveleged user in group wheel:
[0] yak$ id
uid=1001(bouy) gid=0(wheel) groups=0(wheel)
[0] yak$ su
Password:
[0] yak# echo $USER   <==========  EUID unless target is root (0)
bouy                  <==========
[0] yak# id
uid=0(root) gid=0(wheel) groups=0(wheel), 5(operator)
[0] yak# exit
exit

``su -'' issued by unpriveleged user in group wheel:
[0] yak$ su -
Password:
[0] yak# echo $USER   <==========  EUID unless target is root (0)
root                  <==========
[0] yak# id
uid=0(root) gid=0(wheel) groups=0(wheel), 5(operator)
[0] yak# exit
logout
[0] yak$ man su

Note the difference in the USER environment variable. The following code
exists in the shutdown command, therefore the error appears to be that
of a non-zero EUID.

#ifndef DEBUG
        if (geteuid())
                errx(1, "NOT super-user");
#endif

  This makes sense considering a normal `su' does not change the EUID as
stated in the man page => "USER is set to the target login, unless the
target login has a user ID of 0, in which case it is unmodified."

Hope this helps

-- 
Mike Eubanks <mse_software@charter.net>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1132552382.2267.25.camel>