{"Entry":{"collection":"auth","key":"peer","name":"peer","aliases":[],"metadata":{"aliases":[],"category":"Authentication and access control","content_hash":"845abdbd37cdd96ae1125e4660eddb2ec0314365050b622c9b9061f0236ebceb","imported_at":"2026-09-30T00:40:33.331784+08:00","name":"peer","name_zh":"","slug":"peer","summary":"Obtain the client's operating system user name from the operating system and check if it matches the requested database user name. This is only available for local connections. See Section 20.9 for details."}},"Definition":{"Collection":"auth","Key":"peer","SourceDatabase":"center","Version":"18","SourceTable":"authentication_method","SourceKey":"peer","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"aliases":[],"attributes":{"configuration":"pg_hba.conf","inventory":"User-visible source authentication method","method":"peer"},"comparison_data":{"documented_option_names":["map"],"method":"peer"},"comparison_hash":"45b9d1e2b3d7866cecb030ab10781f5e9a18a5ec1f244d9e811ee7a623c656ef","description":["Obtain the client's operating system user name from the operating system and check if it matches the requested database user name. This is only available for local connections. See Section 20.9 for details."],"facts":[{"label":"Method","value":"peer"},{"label":"Configuration","value":"pg_hba.conf"},{"label":"Inventory","value":"User-visible source authentication method"}],"manual_html":"\u003cdiv class=\"sect1\" id=\"AUTH-PEER\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2 class=\"title\"\u003e20.9. Peer Authentication \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eThe peer authentication method works by obtaining the client's operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.\u003c/p\u003e\n\u003cp\u003eThe following configuration options are supported for \u003ccode class=\"literal\"\u003epeer\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003emap\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllows for mapping between system and database user names. See \u003ca class=\"xref\" href=\"/docs/18/auth-username-maps.html\" title=\"20.2. User Name Maps\"\u003eSection 20.2\u003c/a\u003e for details.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003ePeer authentication is only available on operating systems providing the \u003ccode class=\"function\"\u003egetpeereid()\u003c/code\u003e function, the \u003ccode class=\"symbol\"\u003eSO_PEERCRED\u003c/code\u003e socket parameter, or similar mechanisms. Currently that includes \u003cspan class=\"systemitem\"\u003eLinux\u003c/span\u003e, most flavors of \u003cspan class=\"systemitem\"\u003eBSD\u003c/span\u003e including \u003cspan class=\"systemitem\"\u003emacOS\u003c/span\u003e, and \u003cspan class=\"systemitem\"\u003eSolaris\u003c/span\u003e.\u003c/p\u003e\n\u003c/div\u003e","manual_path":"/docs/18/auth-peer.html","related":[],"release":{"catalog_fingerprint":"65c93d6048ef30e61023a84f9680fa6a92b1c383b7eb226741170077eb078502","channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"signature":"","sources":[{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"label":"PostgreSQL 18 English manual","path":"auth-peer.html","sha256":"86d38705f6b31453e2191708e816d77363fbc13bb8112c4dff6da88869258eac","url":"/docs/18/auth-peer.html"},{"label":"PostgreSQL 18 English manual","path":"auth-pg-hba-conf.html","sha256":"6340d4abea2e0a3482afc31bcd1599a0fa10dc28a6f1e05d79ba831e2dd0b4c9","url":"/docs/18/auth-pg-hba-conf.html"}],"tables":[{"columns":[{"key":"name","label":"Option or term"},{"key":"description","label":"Meaning"}],"key":"method-options","rows":[{"description":"Allows for mapping between system and database user names. See Section 20.2 for details.","name":"map"}],"title":"Documented method options and alternatives"}]},"ManualEvidence":{"manual_path":"/docs/18/auth-peer.html","release":{"catalog_fingerprint":"65c93d6048ef30e61023a84f9680fa6a92b1c383b7eb226741170077eb078502","channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"label":"PostgreSQL 18 English manual","path":"auth-peer.html","sha256":"86d38705f6b31453e2191708e816d77363fbc13bb8112c4dff6da88869258eac","url":"/docs/18/auth-peer.html"},{"label":"PostgreSQL 18 English manual","path":"auth-pg-hba-conf.html","sha256":"6340d4abea2e0a3482afc31bcd1599a0fa10dc28a6f1e05d79ba831e2dd0b4c9","url":"/docs/18/auth-pg-hba-conf.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"auth","Key":"peer","SourceDatabase":"center","Version":"18","Locale":"en","Title":"peer","Summary":"Obtain the client's operating system user name from the operating system and check if it matches the requested database user name. This is only available for local connections. See Section 20.9 for details.","BodyHTML":"\u003cdiv id=\"AUTH-PEER\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2\u003e20.9. Peer Authentication \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eThe peer authentication method works by obtaining the client\u0026#39;s operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.\u003c/p\u003e\n\u003cp\u003eThe following configuration options are supported for \u003ccode\u003epeer\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003emap\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllows for mapping between system and database user names. See \u003ca href=\"/docs/18/auth-username-maps.html\" rel=\"nofollow\"\u003eSection 20.2\u003c/a\u003e for details.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003ePeer authentication is only available on operating systems providing the \u003ccode\u003egetpeereid()\u003c/code\u003e function, the \u003ccode\u003eSO_PEERCRED\u003c/code\u003e socket parameter, or similar mechanisms. Currently that includes \u003cspan\u003eLinux\u003c/span\u003e, most flavors of \u003cspan\u003eBSD\u003c/span\u003e including \u003cspan\u003emacOS\u003c/span\u003e, and \u003cspan\u003eSolaris\u003c/span\u003e.\u003c/p\u003e\n\u003c/div\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"d5c1af37d33880b0c13c1ee56f0d6fa70041971f502b9181298992d5f1d7595b","Payload":{"description":["Obtain the client's operating system user name from the operating system and check if it matches the requested database user name. This is only available for local connections. See Section 20.9 for details."],"manual_html":"\u003cdiv class=\"sect1\" id=\"AUTH-PEER\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2 class=\"title\"\u003e20.9. Peer Authentication \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eThe peer authentication method works by obtaining the client's operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.\u003c/p\u003e\n\u003cp\u003eThe following configuration options are supported for \u003ccode class=\"literal\"\u003epeer\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003emap\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllows for mapping between system and database user names. See \u003ca class=\"xref\" href=\"/docs/18/auth-username-maps.html\" title=\"20.2. User Name Maps\"\u003eSection 20.2\u003c/a\u003e for details.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003ePeer authentication is only available on operating systems providing the \u003ccode class=\"function\"\u003egetpeereid()\u003c/code\u003e function, the \u003ccode class=\"symbol\"\u003eSO_PEERCRED\u003c/code\u003e socket parameter, or similar mechanisms. Currently that includes \u003cspan class=\"systemitem\"\u003eLinux\u003c/span\u003e, most flavors of \u003cspan class=\"systemitem\"\u003eBSD\u003c/span\u003e including \u003cspan class=\"systemitem\"\u003emacOS\u003c/span\u003e, and \u003cspan class=\"systemitem\"\u003eSolaris\u003c/span\u003e.\u003c/p\u003e\n\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"name","label":"Option or term"},{"key":"description","label":"Meaning"}],"key":"method-options","rows":[{"description":"Allows for mapping between system and database user names. See Section 20.2 for details.","name":"map"}],"title":"Documented method options and alternatives"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
