- there are 2 containers in docker compose:
- jenkins
- remote_host
- there are also 2 keys:
- id_rsa
- id_rsa3.pub
- when remote_host is building id_rsa3.pub is coping into: home/a12/.ssh/authorized_keys
- when I connect to jenkins container via:
- docker exec -it jenkins bash
and try:
- ssh -i id_rsa3 a12@remote_host -> it can connect without password
- but when I configure same Jenkins SSH with this id_rsa3:
- Can't connect to server
SSH was generate by: ssh-keygen -t rsa -m PEM -f id_rsa3
LOGS from Jenkins show -> Auth fail and Can't connect to server
我尝试:ssh-keygen -t rsa -m PEM -f id_rsa3而不是ssh-keygen -f id_rsa3。我尝试:重新启动Jenkins服务。我尝试:从Jenkins容器终端连接到remote_host(它正在工作)我尝试:在Jenkins中重新安装SSH。
1条答案
按热度按时间7bsow1i61#
已解决
解决方案与此主题相关:Ubuntu 22.04 SSH自20.04升级以来RSA密钥不起作用。
解决办法:
在我的例子ssh连接开始工作。