于吉吉的技術(shù)博客

          建造高性能門戶網(wǎng)

            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            65 隨筆 :: 6 文章 :: 149 評(píng)論 :: 0 Trackbacks
          ssh出現(xiàn)permission denied (publickey)問(wèn)題:
          修改/etc/ssh/sshd-config文件.
          將其中的PermitRootLogin no修改為yes
          PubkeyAuthentication yes修改為no
          AuthorizedKeysFile .ssh/authorized_keys前面加上#屏蔽掉,
          PasswordAuthentication no修改為yes就可以了。

          vi /
          etc/ssh/sshd-config (詳細(xì)說(shuō)說(shuō)sshd-config的配置解釋)
          Subsystem       sftp    /usr/libexec/openssh/sftp-server
          Port 22
          Protocol 2
          PermitRootLogin no
          PubkeyAuthentication yes
          AuthorizedKeysFile .ssh/authorized_keys
          #CACertificateFile  /etc/ssh/ca/ca.cert
          PasswordAuthentication no
          PermitEmptyPasswords no
          PrintMotd no
          ChallengeResponseAuthentication no
          UseDNS no
          ClientAliveInterval 60


          Port 22 # SSH 預(yù)設(shè)使用 22 這個(gè) port,您也可以使用多的 port !亦即重復(fù)使用 port 這個(gè)設(shè)定項(xiàng)目即可!

          Protocol 2 # 選擇的 SSH 協(xié)議版本,可以是 1 也可以是 2 ,如果要同時(shí)支持兩者,就必須要使用 2,1 這個(gè)分隔了

          PermitRootLogin no
          # 是否允許 root 登入!預(yù)設(shè)是允許的,但是建議設(shè)定成 no!

          PubkeyAuthentication yes # 是否允許 Public Key

          AuthorizedKeysFile .ssh/authorized_keys # 上面這個(gè)在設(shè)定若要使用不需要密碼登入的賬號(hào)時(shí),那么那個(gè)賬號(hào)的存放檔案所在檔名!

          PasswordAuthentication no # 是否需要密碼的驗(yàn)證

          PermitEmptyPasswords no # 若上面那一項(xiàng)如果設(shè)定為 yes 的話,這一項(xiàng)就最好設(shè)定為 no ,這個(gè)項(xiàng)目在是否允許以空的密碼登入!當(dāng)然不許!

          PrintMotd no # 登入后是否顯示出一些信息呢?例如上次登入的時(shí)間、地點(diǎn)等

          ChallengeResponseAuthentication no # 是否啟用其它的 PAM 模塊!啟用這個(gè)模塊將會(huì)導(dǎo)致 PasswordAuthentication 設(shè)定失效!

          UseDNS no

          ClientAliveInterval 60







          posted on 2011-01-04 14:10 陳于喆 閱讀(71445) 評(píng)論(6)  編輯  收藏 所屬分類: linux

          評(píng)論

          # re: [收藏]ssh: permission denied (publickey) 2014-01-03 21:24 你媽的害死人啊
          PubkeyAuthentication yes修改為no后,重啟SSH后登陸不到主機(jī)了。到機(jī)房又不方便。  回復(fù)  更多評(píng)論
            

          # re: [收藏]ssh: permission denied (publickey) 2014-03-05 14:30 sss
          真你媽的害死人啊。趕緊該博客吧。
            回復(fù)  更多評(píng)論
            

          # re: [收藏]ssh: permission denied (publickey)[未登錄](méi) 2014-07-17 21:37 X
          樓主就是傳說(shuō)中的 坑爹 的  回復(fù)  更多評(píng)論
            

          # re: [收藏]ssh: permission denied (publickey) 2015-06-11 16:13 9898
          文件名打錯(cuò)了  回復(fù)  更多評(píng)論
            

          # re: [收藏]ssh: permission denied (publickey) 2015-07-14 14:04 逗比
          臥槽,坑爹。按照上面的配置做的話,你絕逼要哭暈在廁所  回復(fù)  更多評(píng)論
            

          # re: [收藏]ssh: permission denied (publickey) 2015-07-30 11:21 jasmine
          @逗比
          雖然文章有的地方寫的不對(duì), 但是不看完文章的行為跟你的id太配了.  回復(fù)  更多評(píng)論
            

          主站蜘蛛池模板: 突泉县| 湘潭市| 和平县| 迁西县| 尉氏县| 仁布县| 互助| 怀仁县| 灵璧县| 七台河市| 永城市| 休宁县| 扬州市| 巴青县| 马山县| 白山市| 康保县| 宜阳县| 登封市| 横山县| 全椒县| 安化县| 兴安盟| 靖安县| 通江县| 克拉玛依市| 子洲县| 长汀县| 鹤峰县| 苍溪县| 镇原县| 成安县| 朔州市| 林西县| 凌源市| 金湖县| 咸宁市| 象山县| 乌兰浩特市| 襄汾县| 武安市|