可以在pod中使用ssh吗?

问题描述:

我使用dockerfile基于centos制作了hadoop映像.有4个节点.我想使用ssh-copy-id配置集群.但是发生了错误.

I made hadoop image based on centos using dockerfile. There are 4 nodes. I want to configure cluster using ssh-copy-id. But an error has occurred.

ERROR: ssh: connect to host [ip] port 22: Connection refused

我该如何解决这个问题?

How can I solve this problem?

ssh遵循客户端-服务器体系结构.因此,必须将openssh-server安装在容器中.现在,如果IP地址可路由,则ssh-copy-id和其他命令应该运行.

ssh follows a client-server architecture. So, the openssh-server has to be installed in the container. Now ssh-copy-id and other commands should run if the ip address is routable.