-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5937825
Documentation changes:
KB3HNS 0974243
Merge pull request #1 from go-gitea/main
KB3HNS 221435b
Rebase to latest.
KB3HNS 0b2f6f8
Addressing some PR feedback:
KB3HNS 5371f1b
Merge branch 'go-gitea:main' into main
KB3HNS edbdd19
Rebase code, again.
KB3HNS c43824e
Addressing additional PR comments:
KB3HNS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
|
|
||
| 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) | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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
/etc/shadow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.