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

最新文章

  1. struts-hibernate-ajax完成区县和街道级联下拉框功能(二补充使用json解析list结果集,ajax循环json层级处理)
  2. git开发流程、常用命令及工具、TortoiseGit使用及常见问题
  3. HTML 5 应用程序缓存(下)
  4. wamp开机自启动
  5. scala特质
  6. HTTP中缓存相关
  7. 剑指Offer07 斐波那契数列
  8. ajax post方法
  9. 如何在word2007中并排查看对比显示两个文档
  10. js学习笔记之:时间(三)
  11. mvc和三层架构到底有什么区别
  12. POJ 2411 Mondriaan's Dream (dp + 减少国家)
  13. matplotlib种类
  14. 【译】.NET Core 3.0 中的新变化
  15. CentOS7 配置FTP服务器
  16. windows 10 multi virtual desktop keyboard shortcut
  17. 在ASP.Net环境中,当用户点击报表中的超链接时如何调用Java Script方法?
  18. How to Get the Function Code in R
  19. 深入学习Motan系列(一)——入门及知识zookeeper储备
  20. java web 大总结

热门文章

  1. [Python]小百合十大爬虫
  2. es 批量导入文件
  3. inux跟踪线程的方法:LWP和strace命令
  4. 最短路径——Dijkstra算法和Floyd算法
  5. windows下nodejs与coffeeScript环境搭建
  6. struts1的配置文件详解
  7. input回车问题
  8. 【转载】如何从win8/8.1中文版(核心版)升级到win8/8.1专业版
  9. 【Linux】`ImportError: No module named '_tkinter'
  10. Visual C++ 2010项目在Visual Studio 2013中打开.rc文件提示"undefined keyword or key name: SS_REALSIZECONTROL"解决方法