Securing your account
A password alone is one stolen secret from failure
Two-factor authentication adds something you have to something you know.
Your account can change code that other people run, so it deserves more than a password. With a password only, whoever learns it gets in. And passwords leak all the time. Two factor authentication asks for a second proof: something you have. A thief with only the password is stopped. That second factor can be a code from an authenticator app, a passkey or security key, or the GitHub Mobile app. Text messages work too, but they are the weakest choice.
Securing your account · Going deeper
Protecting an account
Passkeys, recovery codes, tokens and the security log.
Repository roles
Five roles, each adding to the one before
Read, Triage, Write, Maintain, Admin: give the lowest that works.
In an organization, what a person can do in a repository depends on their role. There are five. Everyone, from read upward, can view and clone the code, open issues and comment. From triage upward, they can also manage issues: label, assign and close them. From write upward, they can push code and merge pull requests. Maintain adds repository settings, but only the safe ones. And admin alone can do the dangerous things: delete the repository, change its visibility, and decide who has access.
Repository roles · Going deeper
How access is given
Base permissions, teams and outside collaborators.
Check yourself
Which role is the lowest that fits this person?
Organizations and enterprises
Teams get roles. Enterprises hold organizations
An organization holds repositories and teams. An enterprise holds organizations.
Personal accounts are for people. Shared work lives one level up. An organization is a shared account that owns repositories for a group. Inside it, people are gathered into teams, and each team is given a role on the repositories it needs. Add someone to the team, and they get the access. A large company may have several organizations. An enterprise account holds them all, with one bill, and policies that apply everywhere.
Organizations and enterprises · Going deeper
Roles in an organization
Owner, member, billing manager, security manager.
Enterprise Managed Users
Who owns the account: you, or the company
With Enterprise Managed Users, the identity provider creates and controls accounts.
Who owns the account you work with? Usually, you do. You create a personal account, and your company invites it into its organization. It stays yours: you can contribute to open source with it, and keep it when you leave. With Enterprise Managed Users, it is the other way round. The company's identity provider creates the account, and can remove it. A managed user works only inside the enterprise. It cannot create anything public, or contribute elsewhere.
Enterprise Managed Users · Going deeper
What an organization can decide
Base permissions, visibility, required 2FA and Copilot policy.
Check yourself
What kind of account is mona_acme?
Protected branches
Main accepts changes only through the gate
A branch rule blocks direct pushes and requires a pull request, review and checks.
Having write access should not mean you can change the main branch in any way you like. A rule protects main. Push to it directly, and GitHub rejects the push. The change has to arrive as a pull request from another branch. The rule can demand an approval from a reviewer. It can demand that the status checks pass. Only then can the pull request merge, and main moves forward. Rulesets can apply the same rules to many branches and repositories at once.
Protected branches · Going deeper · 1 of 2
What a branch rule can require
Approvals, code owners, status checks, signed commits.
Protected branches · Going deeper · 2 of 2
Clue words for security and administration
2FA, Triage, internal, EMU and rulesets.
Check yourself
What is this sign-in using?
Lesson complete
You finished “Privacy, security and administration”
Answer the questions along the way to see your score here.