Debian服务器对SSH密钥的初始权限错误

I have a debian server on my pc and want to ssh connect form my mac first of all I generated ssh key ssh-keygen -t rsa in my mac then tried to copy public key to server with ssh-copy-id <server_ip> but got Permission denied, please try again.

I tried ssh-copy-id <root@server_ip> even ssh-copy-id <myusername_in_server@server_ip> and still get same error

Also I updated sshd_config in my server with following changes:

  • 密码验证是
  • PermitRootLogin是
  • RSAAuthentication是
  • PublickeyAuthentication是

and restarted the debian server with sudo systemctl restart sshd

并再次尝试了所有步骤,但出现了相同的错误, 它的有线连接可以使用他们的密码在服务器上的用户之间切换,但是当我使用该密码进行Mac连接时出现权限错误,因此密码正确

还有另一种方法来复制此密钥并手动将其放入debian服务器吗?

评论