-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Improve documentation for PAM and static deployment #21866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
5937825
0974243
221435b
0b2f6f8
5371f1b
edbdd19
c43824e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -166,11 +166,47 @@ Uses the following fields: | |||||||||||||||||
|
||||||||||||||||||
## PAM (Pluggable Authentication Module) | ||||||||||||||||||
|
||||||||||||||||||
To configure PAM, set the 'PAM Service Name' to a filename in `/etc/pam.d/`. To | ||||||||||||||||||
work with normal Linux passwords, the user running Gitea must have read access | ||||||||||||||||||
to `/etc/shadow`. | ||||||||||||||||||
|
||||||||||||||||||
**Note**: PAM support is added via [build-time flags](https://docs.gitea.io/en-us/install-from-source/#build), and the official binaries provided do not have this enabled. | ||||||||||||||||||
This procedure enables PAM authentication. Users may still be added to the | ||||||||||||||||||
system manually using the user administration. PAM provides a mechanism to | ||||||||||||||||||
automatically add users to the current database by testing them against PAM | ||||||||||||||||||
authentication. To work with normal Linux passwords, the user running Gitea | ||||||||||||||||||
must also have read access to `/etc/shadow` in order to check the validity of | ||||||||||||||||||
the account when logging in using a public key. | ||||||||||||||||||
|
||||||||||||||||||
**Note**: Once a user has been authenticated use of items such as SSH public | ||||||||||||||||||
keys _may_ bypass the login check system. Therefore, if disabling a user, it | ||||||||||||||||||
is recommended to manually disable the account in Gitea using the built-in user | ||||||||||||||||||
manager as well. | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't want to state this because I really don't know and would just be assuming (and you know where that gets people), but I'm guessing that this is also the reason that the application needs read access to the user file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no check performed against PAM when a user logs in with ssh - so if it is intended for them to be disabled admins will need to do this disabling manually. |
||||||||||||||||||
|
||||||||||||||||||
1. Configure and prepare the installation. | ||||||||||||||||||
- It is recommended that you create an administrative user. | ||||||||||||||||||
- Deselecting automatic sign-up may also be desired. | ||||||||||||||||||
1. Once the database has been initialized, log in as the newly created | ||||||||||||||||||
administrative user. | ||||||||||||||||||
1. Navigate to the user setting (icon in top-right corner), and select | ||||||||||||||||||
`Site Administration` -> `Authentication Sources`, and select | ||||||||||||||||||
`Add Authentication Source`. | ||||||||||||||||||
1. Fill out the field as follows: | ||||||||||||||||||
- `Authentication Type` : `PAM` | ||||||||||||||||||
- `Name` : Any value should be valid here, use "System Authentication" if | ||||||||||||||||||
you'd like. | ||||||||||||||||||
- `PAM Service Name` : Select the appropriate file listed under `/etc/pam.d/` | ||||||||||||||||||
that performs the authentication desired.[^1] | ||||||||||||||||||
- `PAM Email Domain` : The e-mail suffix to append to user authentication. | ||||||||||||||||||
For example, if the login system expects a user called `gituser`, and this | ||||||||||||||||||
field is set to `mail.com`, then Gitea will expect the `user email` field | ||||||||||||||||||
for an authenticated GIT instance to be `[email protected]`.[^2] | ||||||||||||||||||
|
||||||||||||||||||
**Note**: PAM support is added via [build-time flags](https://docs.gitea.io/en-us/install-from-source/#build), | ||||||||||||||||||
and the official binaries provided do not have this enabled. PAM requires that | ||||||||||||||||||
the necessary libpam dynamic library be available and the necessary PAM | ||||||||||||||||||
development headers be accessible to the compiler. | ||||||||||||||||||
|
||||||||||||||||||
[^1]: For example, using standard Linux log-in on Debian "Bullseye" use | ||||||||||||||||||
`common-session-noninteractive` - this value may be valid for other flavors of | ||||||||||||||||||
Debian including Ubuntu and Mint, consult your distribution's documentation. | ||||||||||||||||||
[^2]: **This is a required field for PAM**. Be aware: In the above example, the | ||||||||||||||||||
user will log into the Gitea web interface as `gituser` and not `[email protected]` | ||||||||||||||||||
|
||||||||||||||||||
## SMTP (Simple Mail Transfer Protocol) | ||||||||||||||||||
|
||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.