ssh: permission denied (publickey)

来源:互联网 发布:tensorflow windows7 编辑:程序博客网 时间:2024/06/11 16:06

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-serverPort 22Protocol 2PermitRootLogin noPubkeyAuthentication yesAuthorizedKeysFile .ssh/authorized_keysCACertificateFile  /etc/ssh/ca/ca.certPasswordAuthentication noPermitEmptyPasswords noPrintMotd noChallengeResponseAuthentication noUseDNS noClientAliveInterval 60

OK