Обсуждение: "root" execution not permitted. and busybox

Поиск
Список
Период
Сортировка

"root" execution not permitted. and busybox

От
nbald
Дата:
Hi guys,
this is driving me crazy... Do someone have an idea ?

# echo 'pgsql:pgsql:100:100:pgsql:/home/pgsql:/bin/sh' >> /etc/passwd
# su - pgsql
warning: cannot change to home directory


BusyBox v1.7.2 (2010-12-23 22:00:59 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

$ /tmp/mnt/usb0/part1/usr/bin/postmaster -D '/tmp/mnt/usb0/part1/caisse/db'
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise.  See the documentation for
more information on how to properly start the server.
$ su
su: applet requires root privileges!
$
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/root-execution-not-permitted-and-busybox-tp3317041p3317041.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.

Re: "root" execution not permitted. and busybox

От
Tom Lane
Дата:
nbald <nicolas.baldeck@vizille.net> writes:
> this is driving me crazy... Do someone have an idea ?

> # echo 'pgsql:pgsql:100:100:pgsql:/home/pgsql:/bin/sh' >> /etc/passwd

That might have been the only way to create a Unix user account back
around 1972, but it hardly seems like the recommended way now.  Doesn't
your distro provide a tool for that?

> # su - pgsql
> warning: cannot change to home directory

> BusyBox v1.7.2 (2010-12-23 22:00:59 CET) built-in shell (ash)
> Enter 'help' for a list of built-in commands.

> $ /tmp/mnt/usb0/part1/usr/bin/postmaster -D '/tmp/mnt/usb0/part1/caisse/db'
> "root" execution of the PostgreSQL server is not permitted.

It sure looks to me like you got the account creation wrong somehow.
Possibly running "id" here would shed some light on what login state
the postmaster is seeing.

            regards, tom lane

Re: "root" execution not permitted. and busybox

От
Scott Marlowe
Дата:
On Thu, Dec 23, 2010 at 3:35 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> nbald <nicolas.baldeck@vizille.net> writes:
>> this is driving me crazy... Do someone have an idea ?
>
>> # echo 'pgsql:pgsql:100:100:pgsql:/home/pgsql:/bin/sh' >> /etc/passwd
>
> That might have been the only way to create a Unix user account back
> around 1972, but it hardly seems like the recommended way now.  Doesn't
> your distro provide a tool for that?

Every distro I've used in the last 5 or 10 years has either adduser or
useradd and usermod for this kind of stuff.

Re: "root" execution not permitted. and busybox

От
Nicolas BALDECK
Дата:
I'm working on an embedded system, and the bundled busybox doesn't
include useradd nor adduser. So I thought that it was faster to create
the user that way instead of setting a toolchain and recompiling busybox...

Scott Marlowe wrote:
> On Thu, Dec 23, 2010 at 3:35 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> nbald <nicolas.baldeck@vizille.net> writes:
>>
>>> this is driving me crazy... Do someone have an idea ?
>>>
>>> # echo 'pgsql:pgsql:100:100:pgsql:/home/pgsql:/bin/sh' >> /etc/passwd
>>>
>> That might have been the only way to create a Unix user account back
>> around 1972, but it hardly seems like the recommended way now.  Doesn't
>> your distro provide a tool for that?
>>
>
> Every distro I've used in the last 5 or 10 years has either adduser or
> useradd and usermod for this kind of stuff.
>


Re: "root" execution not permitted. and busybox

От
"Daniel J. Summers"
Дата:
On Thu, Dec 23, 2010 at 3:03 PM, nbald <nicolas.baldeck@vizille.net> wrote:

# echo 'pgsql:pgsql:100:100:pgsql:/home/pgsql:/bin/sh' >> /etc/passwd
# su - pgsql
warning: cannot change to home directory

That last line seems to be the problem.  Does /home/pgsql exist?  If it doesn't, and the su command can't complete, you may still be running as root.

--
Daniel J. Summers
Owner, DJS Consulting
E-mail • Website • Support • Tech Blog

GEEKCODE 3.12 GCS/IT d s-:+ a C++ P--- L++ E--- W++ N++ o? K- w !O M--
V PS+ PE++ Y? PGP- t+ 5? X+ R* tv b+ DI++ D+ G- e<++ h---- r+++ y++++