New to GitHub? Secure Your Account in Minutes 🔐 #151380
Replies: 13 comments 8 replies
This comment was marked as spam.
This comment was marked as spam.
-
Hey there! 👋🏾 Missed out on our last community check-in? You can check that out here: Clone, Commit, Conquer: Your New to GitHub Community Check-In 💪. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
If you really wanted to secure the GitHub account, it would not use 2FA, passwords, or API keys. Instead, X.509 client certificates should be used, and it should not require JavaScripts, etc. X.509 certificates can have a passworded private key (and the server never sees the password or the private key). If these certificates are allowed to sign other certificates, then it is possible to create "fine-grained personal access tokens" without an internet connection; this signing certificates is also usable to store a backup on a computer without a internet connection and to use that to sign the certificate that you will actually use, therefore making it more difficult to compromise that certificate (if the one you actually use is compromised, you can revoke it and create and sign a new certificate). However, this is only for securing the GitHub account itself. It is also useful to secure the repositories and supply chain. The stuff you mentioned about ignoring files and not storing secrets is a good advice, although you should also use signed commits and signed releases if you want other users who download the software to verify it, since then it does not require trusting GitHub or Microsoft, that they did not change it or let the government or spies to do so; the users who receive it then only have to trust the author of the software. Fortunately this is already possible. |
Beta Was this translation helpful? Give feedback.
-
(Actually, for ignoring, I prefer to instead make a list of files to include in the repository and automatically exclude all others, rather than a list of files to exclude and include all others. This is probably safer, too.) |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Nice guide, covers the essentials well. Adding a few extra layers from real-world experience:
These steps aren’t theoretical—locked-down credentials and tight workflow hygiene are what let defenders close doors before attackers even knock. |
Beta Was this translation helpful? Give feedback.
-
I'm new comer and I need to know can my funds be protected from scammer |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Keeping your GitHub account and repositories secure is key to protecting your code, personal data, and contributions. Whether you’re just getting started or looking to level up your security, here are some simple but important steps to keep everything safe.
🔑 Securing Your GitHub Account
Adding an extra layer of security with 2FA helps prevent unauthorized access to your account. You can enable this under Settings > Password and authentication. Note that, as of March 2023, GitHub requires all users who contribute code on GitHub.com to enable one or more forms of two-factor authentication (2FA).
potaders
post Keeping Your Account Safe With 2FA FallbacksAvoid reusing passwords and consider using a password manager.
Regularly check Settings > Developer settings > Personal access tokens to ensure only necessary tokens remain active.
Check your security log to see if there are any unexpected login attempts or changes.
🔐 Managing Repository Access and Permissions
Only grant write or admin access to those who need it. Use read-only access for contributors who don’t need to modify the code.
Did you know you can create collaboration teams on GitHub? If you're working within an organization, set up teams with proper access levels instead of granting direct repository access.
Who has access to your repository—and what they can do—matters when it comes to keeping your code safe. A good rule of thumb? Only give people the access they actually need. If someone just needs to view the code, stick with read-only permissions. Remove access for users who no longer need it. For teams, set up roles instead of handing out direct access to individuals. And don’t forget to check in on permissions from time to time—things change, and keeping access up to date helps prevent security risks down the road.
To learn more about keeping your repositories safe, check out our community post: Securing your public GitHub Repos for Free! 🚀
🙈 Best Practices for Handling Sensitive Data and Secrets
Storing secrets like API keys or passwords in your repository is a major security risk. Even in private repos, access settings can change, and once a secret is committed, it stays in Git history—making it hard to fully remove. Attackers even scan public repos for exposed credentials, so a leak can be compromised in seconds. Instead, use environment variables. Secret Scanning can also help catch accidental leaks.
A .gitignore file is a plain text file that contains a list of all the specified files and folders from the project that Git should ignore and not track. You can add sensitive files (e.g., .env, config.json) to your .gitignore to prevent them from being accidentally committed.
This is a question that I see a fair share of in this community. If your GitHub account has been suspended, we recommend the following:
Ensure that you haven’t violated any policies.
Submit a request via GitHub Support to inquire about your account status and next steps.
🚨Please note that account suspensions cannot be resolved in the Community, nor can we escalate your ticket.
—------
By taking these steps, you can keep your account, code, and collaborators safe from security risks. Got any questions or tips of your own? Share them in the discussion below! 💬
Beta Was this translation helpful? Give feedback.
All reactions