iT邦幫忙

2021 iThome 鐵人賽

DAY 24
0
DevOps

不僅是程式碼代管平台 - Github 能做些什麼?系列 第 24

GitHub Account Security - 立刻啟用 Two-factor authentication

雙因子驗證 (Two-factor authentication) 是一種存取服務前的認證授權機制,使用者必須通過兩認證方式才能存取資源。雙因子驗證 (Two-factor authentication) 例子如下:

  1. 登入 Azure 服務時,需要透過 microsoft authenticator app 驗證或輸入數字後才能登入
  2. 使用網路銀行轉帳過程中,需要以簡訊/APP 收取一次性密碼後才能轉帳
  3. 登入手機應用程式時,需透過簡訊收取驗證碼才得以登入

雙因子驗證可以讓你使用 GitHub 服務時更加安全,大幅降低資料洩漏與釣魚攻擊。建議你使用 GitHub 服務時,盡可能啟用多因子驗證功能

GitHub 所提供的雙因子驗證有三種

  1. 簡訊方式(SMS): 透過簡訊傳授授權代碼
  2. TOTP: 透過 Time-based one-time password 手機應用程式即時輸入驗證資訊
  3. Security Key: 有支援 WebAuthn 的硬體設備可以透過此方式

啟用 GitHub Two-factor authentication

  1. 點選右上角個人頭像旁的下拉選單 > Settings
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494HpeHaYxfjI.png

  2. 點選左邊 Account Security > 拉至畫面下方,點選 Enable Two-factor authentication 按鈕
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494RrKJ0jXnZA.png

  3. 輸入密碼確認 (GitHub 重要設定皆要重新輸入密碼確認)
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494z9Zl23rSDh.png

  4. 選擇 Set up using an app,點選 Continue 按鈕
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494Wc7z1b2Dtl.png

  5. 你可以下載 microsoft authenticator 或 google authenticator 手機應用程式,掃描畫面上的 QR Code,輸入取得的代碼
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494WqF6fTM1mN.png

  6. 開啟 microsoft authenticator,點選右上角 + 按鈕
    https://ithelp.ithome.com.tw/upload/images/20210924/200914944QXojy4tgT.jpg

  7. 選擇其他
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494pAF4KdFDiz.jpg

  8. 即可看見 GitHub 的 TOTP
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494t3Y7GioRJX.png

  9. 完成後,會出現恢復資訊在畫面上,當你轉換手機,需要重新安裝應用程式並啟用雙因子驗證,可以透過這些代碼進行恢復。建議你可以下載此檔案。
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494mdBjrxxphj.png

  10. 啟用完成
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494RsSivMFbw2.png

  11. 你可以開啟無痕視窗,重新登入 GitHub。會發現使用帳號密碼登入後,需輸入6位代碼進行驗證。開啟你的手機驗證應用程式 (microsoft authenticator 或 google authenticator),輸入上面的代碼進行登入
    https://ithelp.ithome.com.tw/upload/images/20210924/20091494BW6mIXZwIM.png


閱讀完本篇文章,除了知道何謂雙因子驗證如何啟用 GitHub 雙因子驗證,更希望讀者立刻能為你的 GitHub 帳號啟用起此功能。若喜歡我的文章,歡迎點 like, 分享與訂閱。


上一篇
GitHub Action Security - 小心 workflow 洩漏敏感資訊
下一篇
GitHub Commit signature verification - 確定每次變更來源是可以信任的
系列文
不僅是程式碼代管平台 - Github 能做些什麼?30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言