ssh: permission denied (publickey)

ubuntu服務器只給了公鑰,需要修改ubuntu用戶爲root用戶

sudo passwd root 
sudo vi /etc/ssh/sshd_config 
將PermitRootLogin這一項改爲yes 
sudo service ssh restart

一波操作後結果
ssh: permission denied (publickey)

ssh出現permission denied (publickey)問題:
修改/etc/ssh/sshd-config文件.
將其中的PermitRootLogin no修改爲yes
PubkeyAuthentication yes修改爲no
AuthorizedKeysFile .ssh/authorized_keys前面加上#屏蔽掉,
PasswordAuthentication no修改爲yes就可以了。

vi /etc/ssh/sshd-config (詳細說說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

OK

發佈了203 篇原創文章 · 獲贊 106 · 訪問量 280萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章