<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Shiro 授權 原文鏈接 : [http://zeppelin.apache.org/docs/0.7.2/security/shiroauthentication.html](http://zeppelin.apache.org/docs/0.7.2/security/shiroauthentication.html) 譯文鏈接 : [http://www.apache.wiki/pages/viewpage.action?pageId=10030709](http://www.apache.wiki/pages/viewpage.action?pageId=10030709) 貢獻者 : [小瑤](/display/~chenyao) [ApacheCN](/display/~apachecn) [Apache中文網](/display/~apachechina) ## 概觀 **[Apache Shiro](http://shiro.apache.org/)**?是一個功能強大且易于使用的 **Java** 安全框架,可執行身份驗證,授權,加密和會話管理。在本文檔中,我們將逐步介紹 **Shiro** 如何用于 **Zeppelin** **notebook authentication** ( 筆記本驗證?)。 當您連接到 **Apache Zeppelin** 時,系統將要求您輸入憑據。登錄后,您可以訪問包括其他用戶注釋在內的所有備注。 ## 安全設置 您可以通過一些簡單的步驟設置?**Zeppelin notebook authentication**?。 ### 1.啟用 Shiro 默認情況下是在 **conf** ,你將會找到?**shiro.ini.template** ,以此文件為例,強烈建議您通過執行以下命令創建文件 **shiro.ini** ``` cp conf/shiro.ini.template conf/shiro.ini ``` 有關 **shiro.ini** 文件格式的更多信息?,請參閱?[Shiro配置](http://shiro.apache.org/configuration.html#Configuration-INISections)?。 ### 2.Secure the Websocket channel ( 固定 WebSocket 通道 ) 在?**conf/zeppelin-site.xml** 中設置屬性?**zeppelin.anonymous.allowed** 為 **false** 。如果您還沒有這個文件,只需將**?conf/zeppelin-site.xml.template** 復制到?**conf/zeppelin-site.xml** 。 ### 3.啟動 Zeppelin ``` bin/zeppelin-daemon.sh start (or restart) ``` 然后你可以瀏覽 **Zeppelin** 在?[http://localhost:8080](http://localhost:8080)?。 ### 4.登錄 最后,您可以使用以下 用戶名/密碼 組合之一進行登錄。 ![](https://img.kancloud.cn/f9/2f/f92f0d33e5ab36fa761c36020381f6fe_566x215.jpg) ``` [users] admin = password1, admin user1 = password2, role1, role2 user2 = password3, role3 user3 = password4, role2 ``` 你可以為密碼旁邊的每個用戶設置角色。 ## Groups and permissions (optional) ( 組和權限(可選) ) 如果要利用用戶組和權限,請在 **shiro.ini** 中的 **[main]** 段下使用 **LDAP** 或 **AD** 的以下配置之一。 ``` activeDirectoryRealm = org.apache.zeppelin.realm.ActiveDirectoryGroupRealm activeDirectoryRealm.systemUsername = userNameA activeDirectoryRealm.systemPassword = passwordA activeDirectoryRealm.searchBase = CN=Users,DC=SOME_GROUP,DC=COMPANY,DC=COM activeDirectoryRealm.url = ldap://ldap.test.com:389 activeDirectoryRealm.groupRolesMap = "CN=aGroupName,OU=groups,DC=SOME_GROUP,DC=COMPANY,DC=COM":"group1" activeDirectoryRealm.authorizationCachingEnabled = false ldapRealm = org.apache.zeppelin.server.LdapGroupRealm # search base for ldap groups (only relevant for LdapGroupRealm): ldapRealm.contextFactory.environment[ldap.searchBase] = dc=COMPANY,dc=COM ldapRealm.contextFactory.url = ldap://ldap.test.com:389 ldapRealm.userDnTemplate = uid={0},ou=Users,dc=COMPANY,dc=COM ldapRealm.contextFactory.authenticationMechanism = SIMPLE ``` 還要定義系統中要擁有的角色/組,如下所示; ``` [roles] admin = * hr = * finance = * group1 = * ``` ## Configure Realm (optional) ( 配置領域(可選) ) 領域負責 **Apache Zeppelin** 的身份驗證和授權。默認情況下,**Apache Zeppelin** 使用?**[IniRealm](https://shiro.apache.org/static/latest/apidocs/org/apache/shiro/realm/text/IniRealm.html)**?(用戶和組可配置在?**conf/shiro.ini**?文件**?[user]?**和**?[group]**?部分)。您還可以利用 **Shiro Realms** ,如?**[JndiLdapRealm](https://shiro.apache.org/static/latest/apidocs/org/apache/shiro/realm/ldap/JndiLdapRealm.html)**?,**?[JdbcRealm](https://shiro.apache.org/static/latest/apidocs/org/apache/shiro/realm/jdbc/JdbcRealm.html)?**或創建?[我們自己的](https://shiro.apache.org/static/latest/apidocs/org/apache/shiro/realm/AuthorizingRealm.html)?。要了解有關 **Apache Shiro** 領域的更多信息,請查看?[此文檔](http://shiro.apache.org/realm.html)。 我們還提供社區自定義領域。 ### 活動目錄 ``` activeDirectoryRealm = org.apache.zeppelin.realm.ActiveDirectoryGroupRealm activeDirectoryRealm.systemUsername = userNameA activeDirectoryRealm.systemPassword = passwordA activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://file/user/zeppelin/conf/zeppelin.jceks activeDirectoryRealm.searchBase = CN=Users,DC=SOME_GROUP,DC=COMPANY,DC=COM activeDirectoryRealm.url = ldap://ldap.test.com:389 activeDirectoryRealm.groupRolesMap = "CN=aGroupName,OU=groups,DC=SOME_GROUP,DC=COMPANY,DC=COM":"group1" activeDirectoryRealm.authorizationCachingEnabled = false ``` 而不是在 **shiro.ini** 管理員的明文中指定 **systemPassword** 管理員可以選擇在 **“hadoop憑據”** 中指定相同。使用 **hadoop** 憑據命令行創建密鑰庫文件,因為 **hadoop commons** 應該在類路徑中? `hadoop credential create activeDirectoryRealm.systempassword -provider jceks://file/user/zeppelin/conf/zeppelin.jceks` 更改Shiro.ini文件中的以下值,并取消注釋行: `activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://file/user/zeppelin/conf/zeppelin.jceks` ### LDAP ``` ldapRealm = org.apache.zeppelin.realm.LdapGroupRealm # search base for ldap groups (only relevant for LdapGroupRealm): ldapRealm.contextFactory.environment[ldap.searchBase] = dc=COMPANY,dc=COM ldapRealm.contextFactory.url = ldap://ldap.test.com:389 ldapRealm.userDnTemplate = uid={0},ou=Users,dc=COMPANY,dc=COM ldapRealm.contextFactory.authenticationMechanism = SIMPLE ``` ### PAM **[PAM](https://en.wikipedia.org/wiki/Pluggable_authentication_module)**?認證支持允許在 **Zeppelin** 正在運行的主機上重用現有的認證模塊。在典型的系統模塊中,每個服務配置例如 **sshd** , **passwd** 等?**/etc/pam.d/?**。您可以重新使用這些服務之一或為 **Zeppelin** 創建自己的服務。激活 **PAM** 認證需要兩個參數:1. **realm**:正在使用的 **Shiro** 域 2\. **service** :配置為使用的服務?**/etc/pam.d/**?。這里的名稱需要與下面的文件名相同?**/etc/pam.d/** ``` [main] pamRealm=org.apache.zeppelin.realm.PamRealm pamRealm.service=sshd ``` ### ZeppelinHub **[ZeppelinHub](https://www.zeppelinhub.com/)**?是一種服務,可同步您的 **Apache Zeppelin** 筆記本,并使您輕松協作。 為了使登錄您的 **ZeppelinHub** 證書,應用以下變化`**conf/shiro.ini**?`下?`**[main]**?`節。 ``` ### A sample for configuring ZeppelinHub Realm zeppelinHubRealm = org.apache.zeppelin.realm.ZeppelinHubRealm ## Url of ZeppelinHub zeppelinHubRealm.zeppelinhubUrl = https://www.zeppelinhub.com securityManager.realms = $zeppelinHubRealm ``` 注意 **ZeppelinHub** 沒有被轉交給 **Apache Zeppelin** 項目。 ## 保護您的Zeppelin信息(可選) 默認情況下,定義的任何人都**?[users]**?可以在 **Apache Zeppelin**?中共享解釋器設置,憑證和配置信息。有時您可能希望隱藏這些用于您的用例的信息。由于 **Shiro** 提供了基于 **URL** 的安全性,您可以通過在下面的行中注釋或取消注釋來隱藏信息**?conf/shiro.ini**?。 ``` [urls] /api/interpreter/** = authc, roles[admin] /api/configurations/** = authc, roles[admin] /api/credential/** = authc, roles[admin] ``` 在這種情況下,只有具有 **admin** 角色的角色才能看到解釋器設置,憑據和配置信息。如果要向其他用戶授予此權限,您可以按照在部分中定義的角色[]進行更改**?[users]**?。 注意 所有上述配置都在 **conf/shiro.ini** 文件中定義。 ## 其他認證方式 * [使用 **NGINX** 的 **HTTP** 基本認證](http://zeppelin.apache.org/docs/0.7.2/security/authentication.html)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看