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 | 
轉載于:https://www.cnblogs.com/SZLLQ2000/p/4691274.html
總結
以上是生活随笔為你收集整理的docker and ssh issues的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: 棋盘问题 简单搜索DFS
 - 下一篇: AJAX跨域请访问的问题