On 08 Jan 2000, Harry Putnam <[EMAIL PROTECTED]> wrote:
> Daniel Pittman <[EMAIL PROTECTED]> writes:
>
>> On 08 Jan 2000, Harry Putnam <[EMAIL PROTECTED]> wrote:
>>
>> [...]
>>
>> > I want to use ssh scp rsync.
>>
>> Do you want to use scp(1) or rsync(1) to transfer the files? They
>> both do the same thing in the end (rsync is actually no faster, as I
>> understand it)
>
> I would like to be able to use either one. Is it really true that rync
> is no faster?
Sorry, I was unclear there. rsync is identical to scp in performance
_under rcp only_ because rcp does not cache local copies of files yet
(to the best of my knowledge).
> My experience outside of rcp.el and emacs is that rsync is many times
> faster, depending on how many files are actually moved etc.
Yes. Sorry. I should have been more clear about the context I was
talking in.
[...]
>> What you want to set is `rcp-default-method', indicating the
>> preferred method from that alist to use.
>
> Yes, I understood the list was not to be edited but was talking about
> choosing methods from it.
>
>> In your case that would be `scp' to use scp(1) for transfers or
>> `rsync' if you prefer to use rsync to transfer files.
>
> So, choosing one or the other would make it the default, but the other
> would be available if I specify it in the command syntax?
Yes. That's correct.
[...]
>> Personally, the `scp' method suits me. I run the ssh-agent and that
>> has my identity available to it, allowing me to authenticate to
>> remote machines without a password.
>>
>> So, your choices (presuming that you want ssh security) are:
>> * Use an `inline' transfer method
>> * Use an `out-of-band' transfer method and ssh-agent(1)
>
> But according to the comment I can only use `out of band' if I don't
> have to log in. Something is screwy there.
Yeah, the comment is. :)
The way that rcp works is that it uses rsh or anything that works in a
similar way to log in to the remote machine as a user. It then does a
whole bunch of stuff through that directly (file existence, information,
that sort of thing).
When you want to visit a file in Emacs, rcp copies the file from the
remote machine to a local file and inserts the content in a buffer. The
reverse is done to save the file.
The actual transfer of the files can be done in two ways:
* `inline' to the initial login shell (using base64 or uuencode)
* `out-of-band' with rcp or a similar program.
It's only the rcp (or, in your case, scp) program that needs to be able
to connect to the remote machine without a password. Using an inline
method only requires the one login and will work with or without a
password prompt.
> I don't want to use any agents at all. I understood rcp.el would allow
> me to use ssh in emacs including scp. That comment says only if I
> don't have to log in with a password, but I do, so is rcp.el useless
> for me then?
No. Try the various inline methods for your work. They will operate
correctly even when a password is required to log in to the remote
machine.
The out-of-band methods will /not/ work unless the scp or rsync command
can transfer the files without being interactive at all.
>> > I never have used ange-ftp like that but like below:
>> > /reader@HOST:/path/file or
>> > /ftp@HOST:/path/file
>> >
>> > So what role does the lowercase "r" play ... What goes in METHOD?
>>
>> That might actually be shown better as:
>>
>> /r[@<method>]:[<user>@]<host>:<filename>
>
> What role does the lower case "r" play. Is it another indication
> of a METHOD?
No. The `r' indicates that the file is an rcp file. It has *nothing* to
do with the particular method that rcp uses.
[...]
> Started an emacs that has *NO* require ange-ftp or require rcp code
> Evaled (require 'ange-ftp) then (require 'rcp)
[...]
> Still not clear what the actual syntax is supposed to look like... so
> trying:
> /s@scp:reader@<HOST>:/home/reader/.emacs gives:
/r@scp:reader@host:/home/reader/.emacs
The `r' is not optional. The `s' in your example above is erroneous.
The variable `rcp-file-name-regexp' is a regular expression that *must*
match the filename in order for rcp to act on it.
[...]
> If I just want to read the remote .emacs with local emacs using ssh,
> can I do that with rcp.el?
Yes.
[...]
> Having to do some guessing game with the syntax should be made
> unnecessary by having clear and real examples available somewhere in
> documentation or comments. Seems that would be a bare minimum.
The examples all show the syntax with the `r' in place. If there is one
that has `s' anywhere, please post the file and line number (or info
section) so that it can be corrected.
As to examples, these are filenames that work for me using rcp locally:
/r:melancholia:~/.bashrc
/r@scp:melancholia:~/.bashrc
/r:daniel@melancholia:~/.bashrc
/r@sm:melancholia:~/.bashrc
/r@sm:melancholia.danann.net:/etc/squid.conf
My default method, incidentally, is scp. As I noted, I use the ssh-agent
to allow me to log in without a password. Without that I wouldn't be
able to use the scp method.
> This seems to be going nowhere fast. Why is ftp even coming into the
> picture?
The path is similar to the efs or ange-ftp paths; when rcp fails to
match they notice the filename and get confused. If you see any ftp
involvement when using the correct syntax, that indicates a bug. :)
It's well worth noting, I think, that this software is not ready for the
prime time yet. It's still mostly suitable for lisp hackers and all, the
rough edges still being, well, rough.
Daniel
--
Dreams are true while they last, and do we not live in dreams?
-- Alfred Lord Tennyson, _The Higher Pantheism_