Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0TGW-00BcDg-0r for pgsql-general@arkaria.postgresql.org; Mon, 14 Oct 2024 22:10:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t0TGS-000Iw0-U0 for pgsql-general@arkaria.postgresql.org; Mon, 14 Oct 2024 22:10:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0TGS-000Ivr-B5 for pgsql-general@lists.postgresql.org; Mon, 14 Oct 2024 22:10:08 +0000 Received: from mail-sy4aus01olkn20806.outbound.protection.outlook.com ([2a01:111:f403:2819::806] helo=AUS01-SY4-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0TGP-000u50-IW for pgsql-general@lists.postgresql.org; Mon, 14 Oct 2024 22:10:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VRRNxcYQVRvTAfS2vRKRHXglwymC/v6wfKHbTyA0WxE6o0PpPSC62mFErRvmeuda9bWAN4uqaDoWTgD7XPni11qcFPhR5/ueb9x93/WK48w73Wid1mhN1eKcJ8aYWfKa50f1EMJbGh9eGf4GqZYS+mVmewcwV+A0lvYvNd8iyFUJD4AL5VUxpNbp+pBimROZulO6OFiV8TbCH5hIAapEGliW8HAqv8BKG5lkSCd92XLKINmJh4i5v3pU/RmjH/p6UJhm5aj9LzRmHkLINeNP+V9cZgMqRKdbiN7J60efr/Dh3U1wLx8QX+2R1hWFLjLH64SIe2dW2Wb6eJZV1hs5mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Zf+Qd/w7zIxoQwtq82E9/1T+wcWnFwz71kVC1C9DCf4=; b=wKYCplOcPJ0DwmWz2a994j0PLuiRO1Gv62EM2DQIJ2BgQzPFRCnF+gg6Lkbc1hoOw87WAWIJkvXDCklslEuOneLSfJDqN4Ku25ISwSWDmjDZse3BBbtoubryOvuk8OkzCkGfoX+UK00EpoRd9IUtDPK4EEgGlbCZRftUKQfw/KjxQHsbG18yYgTUEnTA938KJY17auY/wi0s/Gw4Pb373U8FMv75PzVmrnTrUL/byesWVkDnq7csUXlTmxt1dhnOkrALqQsFYFwz8v8Cd9f60ThGqRCJtRO40UGjLepFgHbyWTneFC9aRJttOCXnnuQ/KNyjbgMvyx7ne3aPFx7/Tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zf+Qd/w7zIxoQwtq82E9/1T+wcWnFwz71kVC1C9DCf4=; b=f/GwatQ88nE8oZ6u4rZg6CMzkYcIG3zSVVlFxy8Bcev7R+Ui83Z8F+/DVFyO73FgSC5slXHkpGyaSX8rRINCmY3HLYEKTAfOAa/whoqKiNegb55OmKz/UnyT9WvGUQMqGZcY7OuSkH0Mnt5dCxI71UZ28LYOY3dy6wPLvoejMpIfvEHSr/e3KH6OHlZsgP07v9h+ucqWuzdatR/tZTXwWh8wTY4cdxQSNT0AU+aW2xlEXJWaVMkUcBAC7WTCqwora36tx6I1PJgdc3WUWIZhjql1SF0n8LaxJ+wz8zmZ6gbV2G5HWj8hroiuxQiqCcN6euha7TaqslXPJX5ji8e5zg== Received: from ME3P282MB3328.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:135::19) by SY6P282MB4086.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:1da::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.16; Mon, 14 Oct 2024 22:09:59 +0000 Received: from ME3P282MB3328.AUSP282.PROD.OUTLOOK.COM ([fe80::581d:1388:1607:e43]) by ME3P282MB3328.AUSP282.PROD.OUTLOOK.COM ([fe80::581d:1388:1607:e43%6]) with mapi id 15.20.8069.016; Mon, 14 Oct 2024 22:09:59 +0000 From: Zac Warham To: Adrian Klaver , "pgsql-general@lists.postgresql.org" Subject: Re: Changing postgres User Thread-Topic: Changing postgres User Thread-Index: AQHbHnSPvczEV2/ssUq6PpI2wNnPwbKGyEOAgAAF4+8= Date: Mon, 14 Oct 2024 22:09:59 +0000 Message-ID: References: <685640e7-4533-4483-acfc-d8dc60de5515@aklaver.com> In-Reply-To: <685640e7-4533-4483-acfc-d8dc60de5515@aklaver.com> Accept-Language: en-AU, en-US Content-Language: en-AU X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: ME3P282MB3328:EE_|SY6P282MB4086:EE_ x-ms-office365-filtering-correlation-id: 4f7c2f2e-2d8f-452c-2db8-08dcec9cf1a5 x-microsoft-antispam: BCL:0;ARA:14566002|12050799009|8062599003|461199028|8060799006|15030799003|7092599003|19110799003|15080799006|9400799024|4302099013|3412199025|440099028|102099032|10035399004|1602099012; x-microsoft-antispam-message-info: =?us-ascii?Q?PxV7r6BJEQkidkYykmi54r9sCQduMlSWIwFaVU08SfEj24HVt7JrKOWmfG7K?= =?us-ascii?Q?J3QCGqv52T3ewedDWRFCjsx/cinlAncQNq5bMtEWWhiTfXZw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aEWLEtslAYvGymkj0vw+s=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?B/DYYYezEcpxG5fCWMUrjV0sshxGKdLHgUFWneUspWq7MNPWoneFzyGi1jWL?= =?us-ascii?Q?HvvVBAYzBReXdH2ZTQ9bPwLDuHwAKmf9at4Rj5jMSbCYMf0zZygR7RwynUwz?= =?us-ascii?Q?jaTPDE3meBu6Cw4BGcgBT7S2rBcuimBTjqXbQKWxsg86zpGJ6stQLdrYMoWs?= =?us-ascii?Q?oAvoKY+x2E6jlK7aoirIU10UlTROYNFrKr3ydJMPBnevNiYlKB0PTuwtVvof?= =?us-ascii?Q?JST23WRjh1cb+TbPhjzz/HQMn4oxoiKg8214lOyXPO+DuGb8TtZA3DEpjaZO?= =?us-ascii?Q?wCKIJUF+ZqnbF65qwDc6zzc38RK/iijtFyWie77SFOiUG5gOi01hW0ku9qJa?= =?us-ascii?Q?Tj85hwCU52rr/QtPKxitMn7Ybr3AmPdQVOLXyAorW7UCEJm86heFdPB2Sj5I?= =?us-ascii?Q?CxrMRts4w1w3KCFiSN5y1+IyUwLC+Mtj1mzC7DXhCPpLhjzs+2vBWLjkvq15?= =?us-ascii?Q?D7VCCZWFnHiSZ1lwQHx52hA//XCQ+k5OT2zcy6jXp4rGnBtGJJcrbVechk5/?= =?us-ascii?Q?M2YppWP+LV9e6cvdjZOKKY1531Ryg6vRMT5pf7X4q3te4L8qiNx96i11Ko+R?= =?us-ascii?Q?WIdn8ekWo7aoKC7S6ZQrTKhrTBH1nwiD5MCXfnifwmCeptz0hxFUbdsObGJB?= =?us-ascii?Q?7TIW7W3l2NmvtYAPONJcJ72UJ3p6JluMOKqRML+hWIPXtPfA6Mr20teIkxyf?= =?us-ascii?Q?GIPDXTQBAr0uuEahCJ6i9EP7Q13OKmB8ZyFGucI9yFkZMB5gDbXA18TRULm9?= =?us-ascii?Q?MO0Q+U2TWCoDc6Bo0DxiLlUooPT3lJgsBV5TWOQo+D6jYqtTeWDSG+jopr7c?= =?us-ascii?Q?vlr4gCFtMxjgXAaDK8ui9koN7ysYPagarhdYpPqIke1t9m1CbgrNRXw5AVxN?= =?us-ascii?Q?kSRKHHtNYRvEK4clCuJkDbb7AwPSMaPFVzUKEWTfjtsGSDKs5DLpmLOMOqn+?= =?us-ascii?Q?kWE60E/sU4nApv+RSjw7APMXiDjWaxsSYW/B01FJD8hb6qfL1DDiyfx3aXCo?= =?us-ascii?Q?lSz+c00bURlHUqKPbZ0uFy5yCtl3VKWlMRzz5v/frvwFhAo1LFpAqRwJfJJH?= =?us-ascii?Q?B2PLBhEqgwJ4kMMrnhgYJk2aio1VgZmzCmJtWHkNwPP4SvnNdrzstReeczxo?= =?us-ascii?Q?7W1nm591LEq0eZBMDSA7jLH9erUgl8HASwSu+grVaZP0YxCale7Ghnaq+8io?= =?us-ascii?Q?EOfvOZP+SWUDflQuvCwl2gF7PPzUgz7kHhubKM/+l9n6qrLaRACm3zN+Tx0?= =?us-ascii?Q?=3D?= Content-Type: multipart/alternative; boundary="_000_ME3P282MB3328FDD3AD68DFD183B1E9A4B7442ME3P282MB3328AUSP_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-722bc.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: ME3P282MB3328.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 4f7c2f2e-2d8f-452c-2db8-08dcec9cf1a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2024 22:09:59.2874 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY6P282MB4086 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_ME3P282MB3328FDD3AD68DFD183B1E9A4B7442ME3P282MB3328AUSP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Adrian, Thank you for the link to the documentation however it is the UID and GID o= f 1001:1001 that is required, not the username which I believe this is inte= nded for? Is there a similar option for UID and GID? Apologies if my origin= al question was not clear in this manner. Zac ________________________________ From: Adrian Klaver Sent: Monday, 14 October 2024 2:46 PM To: Zac Warham ; pgsql-general@lists.postgresql.org = Subject: Re: Changing postgres User On 10/14/24 13:11, Zac Warham wrote: > Hi, > > We are trying to setup a postgresql Docker container alongside pgadmin > and caddy for use in the PrairieLearn student testing software. Our main > set back is that the PrairieLearn production environment user runs as > user 1001:1001 and as such we have had to rename the postgres user > within Linux to 1001 and alter the credentials management significantly. Why? Per: https://aus01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fwww.pos= tgresql.org%2Fdocs%2Fcurrent%2Fapp-initdb.html&data=3D05%7C02%7C%7C545e2e27= 90694e5ec81a08dcec99ba83%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63864= 5392223140652%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiL= CJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3DLNVisA1Cm%2BK8twl9PxP18k= l8zcDsgo77ySEvtIuXfZI%3D&reserved=3D0 You can have the initdb create the cluster as any user: "-U username --username=3Dusername Sets the user name of the bootstrap superuser. This defaults to the name of the operating-system user running initdb. " > > We are currently brainstorming some better ways but if anyone has any > suggestions on easier ways to make these changes then we would > appreciate them. The code is open source and can be viewed here - > https://aus01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithu= b.com%2FPrairieLearn%2FPrairieLearn%2Fpull%2F10713&data=3D05%7C02%7C%7C545e= 2e2790694e5ec81a08dcec99ba83%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C6= 38645392223163417%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM= zIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3D3Rj3%2BG4PYJIEzymBaK= dl%2BbkooYroK7HzH3M2eHM2f8Y%3D&reserved=3D0 > > > > Thanks, > Zac -- Adrian Klaver adrian.klaver@aklaver.com --_000_ME3P282MB3328FDD3AD68DFD183B1E9A4B7442ME3P282MB3328AUSP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi Adrian,

Thank you for the link to the documentation however it is the UID and GID o= f 1001:1001 that is required, not the username which I believe this is inte= nded for? Is there a similar option for UID and GID? Apologies if my origin= al question was not clear in this manner.

Zac

From: Adrian Klaver <adr= ian.klaver@aklaver.com>
Sent: Monday, 14 October 2024 2:46 PM
To: Zac Warham <cazwarham@hotmail.com>; pgsql-general@lists.po= stgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Changing postgres User
 
On 10/14/24 13:11, Zac Warham wrote:
> Hi,
>
> We are trying to setup a postgresql Docker container alongside pgadmin=
> and caddy for use in the PrairieLearn student testing software. Our ma= in
> set back is that the PrairieLearn production environment user runs as =
> user 1001:1001 and as such we have had to rename the postgres user > within Linux to 1001 and alter the credentials management significantl= y.

Why?

Per:

https:/= /aus01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fwww.postgresql= .org%2Fdocs%2Fcurrent%2Fapp-initdb.html&data=3D05%7C02%7C%7C545e2e27906= 94e5ec81a08dcec99ba83%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63864539= 2223140652%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJB= TiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3DLNVisA1Cm%2BK8twl9PxP18= kl8zcDsgo77ySEvtIuXfZI%3D&reserved=3D0

You can have the initdb create the cluster as any user:

"-U username
--username=3Dusername

     Sets the user name of the bootstrap superuser. Thi= s defaults to the
name of the operating-system user running initdb.
"

>
> We are currently brainstorming some better ways but if anyone has any =
> suggestions on easier ways to make these changes then we would
> appreciate them. The code is open source and can be viewed here -
> ht= tps://aus01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.co= m%2FPrairieLearn%2FPrairieLearn%2Fpull%2F10713&data=3D05%7C02%7C%7C545e= 2e2790694e5ec81a08dcec99ba83%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C6= 38645392223163417%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM= zIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3D3Rj3%2BG4PYJIEzy= mBaKdl%2BbkooYroK7HzH3M2eHM2f8Y%3D&reserved=3D0
> <https://aus01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithu= b.com%2FPrairieLearn%2FPrairieLearn%2Fpull%2F10713&data=3D05%7C02%7C%7C= 545e2e2790694e5ec81a08dcec99ba83%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0= %7C638645392223177366%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV= 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3Dgy3LgO2pe7Fh= iL28lfLfNBO8Y1%2B2BDunSR%2FDsFE8wyU%3D&reserved=3D0>
>
> Thanks,
> Zac

--
Adrian Klaver
adrian.klaver@aklaver.com

--_000_ME3P282MB3328FDD3AD68DFD183B1E9A4B7442ME3P282MB3328AUSP_--