unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gábor Boskovits" <boskovits@gmail.com>
To: Giovanni Biscuolo <g@xelera.eu>
Cc: 38198@debbugs.gnu.org
Subject: bug#38198: missing shell for postgresql system user
Date: Wed, 13 Nov 2019 20:36:08 +0100	[thread overview]
Message-ID: <CAE4v=pjLFcXP3014+xb6w0fA7iVVEKArey83_E=Zdd0zeAjoGA@mail.gmail.com> (raw)
In-Reply-To: <87k183oeyz.fsf@roquette.mug.biscuolo.net>

Hello,

Giovanni Biscuolo <g@xelera.eu> ezt írta (időpont: 2019. nov. 13., Sze, 18:38):
>
> Hello Guix!
>
> Current postgresql access rules (pg_hba.conf) defaults to (see
> [bug#36191] for details on that patch):
>
> --8<---------------cut here---------------start------------->8---
> local   all     all                     peer
> host    all     all     127.0.0.1/32    md5
> host    all     all     ::1/128         md5
> --8<---------------cut here---------------end--------------->8---
>
> Peer authentication works by obtaining the (local) client's operating
> system user name from the kernel and using it as the allowed database
> user name, and is better than "trust" authentication
>
> To access a database server on localhost for the first time as the user
> postgres (the superuser) a person should use:
>
> --8<---------------cut here---------------start------------->8---
> sudo su postgres -c 'psql'
> --8<---------------cut here---------------end--------------->8---
>
> AFAIK this is the only method available after database initialization,
> with peer authentication
>
> Since the postgres user currently have a nologin shell (from
> gnu/services/databases.scm):
>
> --8<---------------cut here---------------start------------->8---
> (define %postgresql-accounts
>   (list (user-group (name "postgres") (system? #t))
>         (user-account
>          (name "postgres")
>          (group "postgres")
>          (system? #t)
>          (comment "PostgreSQL server user")
>          (home-directory "/var/empty")
>          (shell (file-append shadow "/sbin/nologin")))))
> --8<---------------cut here---------------end--------------->8---
>
> the above command does not work
>
> As a workaround I changed the postgres user shell to <store>/bin/bash
> and I was able to connect
>
> I do not see any security issue giving a shell to postgres, since it's
> password is disabled in /etc/shadow so the only way to access as
> postgres is via `sudo su postgres`

I would not mind this change, I think it is ok. However it is easy to
work around this with su -s.
I usually do that.
>
> Thougts?
>
> Thanks, Gio'
>
> --
> Giovanni Biscuolo
>
> Xelera IT Infrastructures


Best regards,
g_bor
-- 
OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21

  reply	other threads:[~2019-11-13 19:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13 17:36 bug#38198: missing shell for postgresql system user Giovanni Biscuolo
2019-11-13 19:36 ` Gábor Boskovits [this message]
2019-11-14 10:02   ` Giovanni Biscuolo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAE4v=pjLFcXP3014+xb6w0fA7iVVEKArey83_E=Zdd0zeAjoGA@mail.gmail.com' \
    --to=boskovits@gmail.com \
    --cc=38198@debbugs.gnu.org \
    --cc=g@xelera.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).