最近個人新項目友鏈聯盟youlianplus.com項目即將完成,準備拿到阿里雲試試,在阿里雲華北3購買了一臺迷你服務器,1核1g40g硬盤,打算測試一下。shell
買了以後,準備用ssh登陸進去,結果出現了個permission denied
權限被拒絕的問題,詳情以下:服務器
chengmingdeMacBook-Pro:blog cmlanche$ ssh root@47.92.24.241 The authenticity of host '47.92.24.241 (47.92.24.241)' can't be established. ECDSA key fingerprint is SHA256:PYBgUIuFIYcBUCzUGG0qLJDGH2At/dQ+zk+Q9tyX7+E. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '47.92.24.241' (ECDSA) to the list of known hosts. Permission denied (publickey). chengmingdeMacBook-Pro:blog cmlanche$ ssh root@47.92.24.241 Permission denied (publickey). chengmingdeMacBook-Pro:blog cmlanche$ ssh root@47.92.24.241 Permission denied (publickey).
意思是說,沒法用publickey來登陸服務器,那問題確定出在服務器那邊的配置上了,百度找了個解決辦法,有效!http://www.javashuo.com/article/p-pdoxnndi-gx.htmlssh
幸虧阿里雲控制檯界面有一個遠程鏈接的控制,經過這個入口進去,能夠直接登陸。測試
進去後,注意要保存好鏈接碼,這個碼只會出現一次!就保存在你電腦中就行了。阿里雲
關鍵步驟:spa
vi /etc/ssh/sshd_config
修改PasswordAuthentication的值爲yes,注意把簽名的#去掉.net
PasswordAuthentication yes
上文鏈接說要重啓httpd服務,其實沒啥做用,我們來硬的,直接重啓服務器就行了!code