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

                **1、創建用戶yanmin** ~~~ 1.新建用戶 adduser sean 2.新建密碼 //輸入兩次密碼 # passwd sean Changing password for user sean New password: SEANzhui565520 Retype new password: passwd: all authentication tokens updated successfully cat /etc/passwd 可以查看所有用戶的列表 w 可以查看當前活躍的用戶列表 cat /etc/group 查看用戶組 ~~~ **2、禁止root登錄** ~~~ 1.編輯 sudoers文件 vim /etc/sudoers ,在root ALL=(ALL) ALL下添加以下代碼 sean ALL=(ALL) ALL 2.編輯vim /etc/ssh/sshd_config 修改#PermitRootLogin yes 為PermitRootLogin no 3.賦予sean用戶root權限 A.在root ALL=(ALL) ALL下添加以下代碼 sean ALL=(ALL) ALL B.第二種方案,把用戶ID修改為0 sean:x:0:1000:sean,,,:/home/sean:/bin/bash ~~~ **3、使用SSH密鑰認證** ~~~ 在通過SSH訪問服務器時,使用SSH密鑰進行認證是尤其重要的。這樣做為服務器增加了額外的保護,確保只有那些擁有密鑰的人才能訪問服務器。 在本地機器上運行下面命令以生成SSH密鑰: ssh-keygen -t rsa 你會看到下面的輸出,詢問要將密鑰寫到哪一個文件里,并且設置一個密碼: Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): my_key Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in my_key. Your public key has been saved in my_key.pub. The key fingerprint is: SHA256:MqD/pzzTRsCjZb6mpfjyrr5v1pJLBcgprR5tjNoI20A 完成之后,就得到兩個文件: my\_key my\_key.pub 接下來把my\_key.pub拷貝到~/.ssh/authorized\_key中 cp my_key.pub ~/.ssh/authorized_keys 然后使用下面命令將密鑰上傳到服務器: scp -P16543 authorized_keys user@yourserver-ip:/home/user/.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>

                              哎呀哎呀视频在线观看