【发布时间】:2011-07-05 19:18:43
【问题描述】:
我已经在本地和远程之间设置了 ssh 密钥对。
ssh 登录无需输入密码
user@local ~$ssh -v remote
..
debug1: Authentications that can continue: publickey..
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/user/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).
..
debug1: Entering interactive session.
user@remote ~$
rsync over ssh 在非 rsyncd 模式下工作(注意单 :),但问题是在此模式下不咨询 rsyncd.conf。
user@local ~/bin$rsync -av -e "ssh -v -l user@remote" user@remote:/dir
..
debug1: Authentications that can continue: publickey..
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/punkish/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).
..
debug1: Entering interactive session.
debug1: Sending command: rsync --server --sender -vlogDtpre.iLs . /dir
receiving file list ... done
..
user@local ~/bin$
在 rsyncd 模式下通过 ssh 进行 rsync 失败(注意双 ::),并且需要密码。
user@local ~/bin$rsync -av -e "ssh -v -l user@remote" user@remote::module
..
debug1: Authentications that can continue: publickey..
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/punkish/.ssh/id_rsa
debug1: Authentications that can continue: publickey..
debug1: Next authentication method: keyboard-interactive
Password:
我做错了什么?我的目标是在远程机器上使用 rsyncd.conf 运行 rsync。
【问题讨论】:
-
你确定
-l标志到ssh这里吗?我认为应该是ssh -l user remote或ssh user@remote。 -
Gosh dangit...就是这样。更改为
ssh user@remote效果很好。非常感谢。 -
所以我发布了这个作为答案,你可以接受。