無法使用ssh-copy-id root@IP - Linux

Table of Contents

是這樣的
最近在學習用ansible部屬K8S

參考網站:https://reurl.cc/vg0ZQA
mgmt 192.168.0.101
node1 192.168.0.102


其中要在mgmt這台輸入ssh-copy-id [email protected]把私鑰丟過去node1
都會顯示access denied

已有
1.passwd root 修改root密碼
2.修改sshd_config >>>PermitRootLogin yes
3.重啟sshd systemctl restart sshd

也有看到2018的文章說要在sshd_config內新增
AllowUser root
這段
但還是一樣
不知道有沒有人知道怎解

Ubuntu版本20.04

--

All Comments

Eden avatarEden2021-10-19
查一下 sudo journalctl -u ssh 自己問題自己解
Victoria avatarVictoria2021-10-22
懷疑是權限(mode bits)設定錯了但沒證據
Steve avatarSteve2021-10-26
不要copy id 直接ssh 會過嗎?
另外,真的不要開PermitRootLogin 非常危險
Carol avatarCarol2021-10-30
如果有啟用ufw關掉看看
Lydia avatarLydia2021-11-03
ufw 有開的話連 access denied 都不會出現吧
Liam avatarLiam2021-11-07
node1 /root/.ssh 的權限也可以檢查
Candice avatarCandice2021-11-11
你會不會本來就是用key登入的,不是用password登入