日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

docker and ssh issues

發布時間:2025/3/20 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 docker and ssh issues 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

docker run -i -t qcdatainc/centos-jdk
yum update

yum install openssh-server

ssh -vvv -p 222 jenkins@172.17.0.17 //investigate ssh problems.

解決問題的思路:
1、先看看ssh服務是否啟動。(service sshd status)
2、檢查iptables防火墻是否攔截。(iptables -L)
3、檢查/etc/hosts.allow,/etc/hosts.deny配置文件

SSH 客戶端登陸以后自動退出

用-v 調試 部分日志:

ssh -v root@127.0.0.1 -p 23

23端口映射docker的一個centos容器

debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
root@127.0.0.1's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = zh_CN.UTF-8
Last login: Mon Jun 23 12:52:01 2014 from 172.17.42.1
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to 127.0.0.1 closed.
Transferred: sent 1912, received 2128 bytes, in 0.0 seconds
Bytes per second: sent 55065.8, received 61286.6
debug1: Exit status 254
此問題 解決方案:

/etc/ssh/sshd_config 中的UsePAM yes 改成no

即可登錄。

或者在docker file中加入

RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config

?

如果添加指紋的時候提示添加失敗,是因為你以前添加過了這個ip的指紋。

   解決辦法:將.ssh目錄的known_hosts文件刪除掉(好粗暴啊( ⊙ o ⊙ )啊!),也可以打開這個文件把對于ip的那條記錄刪除(這個就精細多了O(∩_∩)O哈哈~)

  如果操作步驟都正確,但是依然要求輸入密碼。一般是因為權限的問題。命令如下

chmod 644 ~/.ssh/authorized_keys

?

今天在服務器上執行遠程操作命令出現以下的問題:
[root@www ~]# ssh 205.209.161.**
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@??? WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!???? @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
6c:74:2a:d5:ae:2b:76:51:*:*.

解決方法: 在正在操作的機器上執行
vi ~/.ssh/known_hosts
進入此目錄,刪除的205.209.161.**相關rsa的信息即可. 或者刪除這個文件 cd ~/.ssh/ rm known_hosts

轉載于:https://www.cnblogs.com/SZLLQ2000/p/4691274.html

總結

以上是生活随笔為你收集整理的docker and ssh issues的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。