rsync后无法SSH到远程计算机 [英] Cannot ssh into remote machine after rsync

查看:228
本文介绍了rsync后无法SSH到远程计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用HTTPS保护Docker守护程序套接字上关注了此页面,以生成ca.pem ,server-key.pem,server-cert.pem,key.pem和key-cert.pem

I followed this page on Protecting the Docker daemon Socket with HTTPS to generate ca.pem, server-key.pem, server-cert.pem, key.pem and key-cert.pem

我希望远程Docker守护进程使用这些密钥,所以我使用了通过ssh rsync将三个文件(ca.pem,server-key.pem和key.pem)发送到远程主机的主目录。 ssh进入远程主机的身份文件称为dl-datatest-internal.pem

I wanted a remote Docker daemon to use those keys so i used rsync via ssh to send three of the files(ca.pem, server-key.pem and key.pem) to the remote host's home directory. The identity file for ssh into the remote host is called dl-datatest-internal.pem

ubuntu@ip-10-3-1-174:~$ rsync -avz -progress -e "ssh -i dl-datatest-internal.pem" dockerCer/ core@10.3.1.181:~/
sending incremental file list
./
ca.pem
server-cert.pem
server-key.pem

sent 3,410 bytes  received 79 bytes  6,978.00 bytes/sec
total size is 4,242  speedup is 1.22

此后,远程主机就停止识别身份文件,并开始请求不存在的身份文件

The remote host stopped recognising the identity file ever since and started asking for a non-existent password.

ubuntu@ip-10-3-1-174:~$ ssh -i dl-datatest-internal.pem core@10.3.1.151
core@10.3.1.151's password: 

有人知道吗为什么以及如何解决?如果有帮助的话,我仍然拥有所有键。

Does anyone know why and how to fix it? I still have all the keys if that helps.

推荐答案

rsync命令有一些困扰我的地方,但是,我无法专心解决这个问题(如果有的话)。

There are a couple things about the rsync command that bother me, but, I can't put my finger on the problem (if there is one).


  • rsync命令和后续的ssh命令参考不同的主机:rsync(core@10.3.1.181:〜/
    )和ssh到主机(core@10.3.1.151)。那是不同的机器,不是吗?

  • the rsync command and subsequent ssh command reference different hosts: rsync(core@10.3.1.181:~/ ) and ssh to the host(core@10.3.1.151). Those are different machines, no?

rsync命令目标中的〜。 core@10.3.1.181:〜/我很确定〜/引用了核心主目录,但是,您可以摆脱〜/并将其替换为。 (点)。

the ~ in the target of the rsync command. core@10.3.1.181:~/. I am pretty sure that the ~/ references the core home directory, but, you could just get rid of the ~/ and replace that with a . (dot).

如果可以复制在其中复制的环境,则可以添加--dry -运行到rsync命令以查看将要执行的操作。查看此命令,我看不到它删除了目标的.ssh目录。

If you can reproduce the environment you did the copy in, you can add a --dry-run to the rsync command to see what it is going to do. Looking at this command I can't see it erasing the target's .ssh directory.

这篇关于rsync后无法SSH到远程计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆