1. 程式人生 > 其它 >所選使用者金鑰未在遠端主機上註冊的問題

所選使用者金鑰未在遠端主機上註冊的問題

//同步內容

~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys:
//設定許可權
chmod 600 ~/.ssh/authorized_keys
chmod 700 -R .ssh

//我遇到的原因: root 使用者建立的 id_rsa.pub, xshell 用 其它使用者名稱登入 會提示 所選使用者金鑰未在遠端主機上註冊的問題,換成root 使用者名稱登入就可以了


Connecting to 127.0.0.1:2200...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Welcome to Ubuntu 22.04 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

System information as of Fri May 20 10:12:40 CST 2022

System load: 0.5185546875 Processes: 16
Usage of /home: unknown Users logged in: 0
Memory usage: 70% IPv4 address for wifi0: 192.168.101.119
Swap usage: 0%


36 updates can be applied immediately.
22 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable


Last login: Fri May 20 09:57:02 2022 from 127.0.0.1
root@ZJZL-20220519FY:~#