[Discuss] hosts.equiv

dan moylan jdm at moylan.us
Sun Jun 18 16:06:19 EDT 2023


On Fri, Sep 14, 2012 at 08:40:44AM -0400, dan ritter wrote:

> On Fri, Sep 14, 2012 at 08:40:44AM -0400, dan moylan wrote:

>> i have a script to rsync a number of directories between two
>> computers on my local net and would like to avoid having to
>> enter my password for each one.  i thought i could do this
>> using hosts.equiv, but it's not working for me.  i solved
>> this once before a number of years ago, but i'm undoubtedly
>> forgetting something now.  any help would be appreciated.

> Create ssh keys:
> ssh-keygen -t rsa -b 2048
>
> Change the filename id_rsa to "rsync.key"
> Change the filename id_rsa.pub to "rsync.key.pub"
>
> Don't put in a passphrase.
>
> man sshd. Read the section on Authorized_Keys file format.
> Add restrictions to rsync.key.pub: no-agent-forwarding,
> no-port-forwarding, no-pty, no-X11-forwarding, perhaps a from
> restriction. Make it tight. command = rsync?
>
> Copy rsync.key.pub with the restrictions to your remote machine,
> and cat it to the end of ~/.ssh/authorized_keys
>
> When you run rsync, pass it "-e ssh -i /home/jdm/.ssh/rsync.key"

> You should have a fairly safe passwordless rsync.

your instructions have worked perfectly -- until just this
month when i was bringing a new laptop on line.  didn't know
what to do then so i cleaned out .ssh and went through the
process again, but though ssh works passwordless, rsync does
not.

moylan cmd[448] ssh -p22 -i /home/moylan/.ssh/rsync.key moylan at aldeberan

works without asking for a password.

moylan cmd[449] rsync -r -e ssh -i /home/moylan/.ssh/rsync.key
      /home/moylan/foo moylan at aldeberan:

asks for a password.  i'm doing something wrong, but haven't
a clue as to how to find out what.  any suggestions?

tia,
ole dan

j. daniel moylan
84 harvard ave
brookline, ma 02446-6202
617-777-0207 (cel)
jdm at moylan.us
www.moylan.us
[BLM]


More information about the Discuss mailing list