ssh: connect to host localhost port 22: Connection refused
原因:ssh-server未安装或者未启动
这个问题可用2条语句一次性解决。
yum -y remove openssh-server openssh-client
yum -y install openssh-server openssh-client
把client和server卸载重新安装。
这两个之间应该有依赖关系之前为已经有openssh-server 需安装openssh-client不行
之后卸载重装好了