<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                **限制用戶登錄** 1. 編輯/etc/sshd_config的AllowUsers參數(如果不存在,需要手動創建,用戶之間空格隔開),只允許root和admin用戶:AllowUsers root admin 2. 編輯/etc/sshd_config的DenyUsers參數,不允許admin用戶登錄:DenyUsers admin 3. 編輯/etc/ssh_config的AllowGroups參數,只允許某個用戶組登錄:AllowGroups admingroup 4. 編輯之后需要重啟服務:systemctl restart sshd 5. 如果AllowUsers和DenyUsers參數同時加上admin,則admin賬號仍然無法登錄,由此可見,DenyUsers的優先級更高點 **取消密碼驗證,只用密鑰對驗證** 1. 修改ssh服務配置文件/etc/ssh/sshd\_config PasswordAuthentication no PubkeyAuthentication yes **禁止空密碼登錄** 1. 修改/etc/ssh/sshd\_config PermitEmptyPasswords no **查看ssh登錄日志:ssh日志存儲在/var/log/secure文件中** ``` // 查看被禁止登錄的用戶的登錄日志 [root@izwz91quxhnlkan8kjak5hz /]# cat /var/log/secure | grep DenyUsers Oct 25 21:23:14 izwz91quxhnlkan8kjak5hz sshd[12828]: User admin from 182.16.20.194 not allowed because listed in DenyUsers // 查看允許登錄的用戶的登錄日志 [root@izwz91quxhnlkan8kjak5hz /]# cat /var/log/secure | grep AllowUsers Oct 25 21:12:36 izwz91quxhnlkan8kjak5hz sshd[9648]: User admin from 182.16.20.194 not allowed because not listed in AllowUsers Oct 25 21:15:27 izwz91quxhnlkan8kjak5hz sshd[19163]: User admin from 182.16.20.194 not allowed because not listed in AllowUsers ``` **限制ip進行ssh登錄** 可以通過編輯`/etc/hosts.allow`文件和`/etc/hosts.deny`,以此來允許或者拒絕某個ip或者ip段來訪問linux的某項服務,這里是指具體的linux某項服務,比如sshd。 /etc/hosts.allow 文件和 /etc/hosts.deny 優先級說明: 當客戶IP進行ssh請求連接時,linux的檢查策略是先檢查`/etc/hosts.allow`中是否允許,如果允許直接放行,如果沒有配置,則再檢查`/etc/hosts.deny`中是否禁止,如果禁止那么就禁止連入,因此hosts.allow的優先級更高。 限制ip進行ssh登錄實現步驟: ``` // 第一步:編輯hosts.allow文件,新增一行 sshd:192.168.1.1:allow // 允許 192.168.1.1這個IP地址SSH登錄 sshd:192.168.1.0/24:allow // 允許192.168.1.0/24這個網段的ip登錄 sshd:192.168.1.*:allow // 允許192.168.1.0/24這個網段的ip登錄 all:192.168.2.2 // 表示允許接受這個ip的所有請求! // 第二步:編輯hosts.deny文件,拒絕所有ip登錄,因為在hosts.allow中允許了指定ip,因此只有該ip能夠登錄 sshd:ALL // 拒絕所有ip進行ssh登錄 ```
                  <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>

                              哎呀哎呀视频在线观看