On Wed, May 03, 2000 at 10:03:30AM -0400, Michael H. Warfield wrote:
| On Wed, May 03, 2000 at 08:09:13PM +1000, Cameron Simpson wrote:
| > On Wed, May 03, 2000 at 01:40:33AM -0700, Mike Lewis wrote:
| > | Trying to setup passwordless login using rsync and ssh.
| > | Suppose you have hostname1 that multiple machines will be connecting to
| > | using rsync / ssh.  When setting up the first machine (hostname2) to have a
| > | passwordless login you would use:
| > |   scp identity.pub user@hostname1:/home/username/.ssh/authorized_keys
| > | Now we move to hostname3.  Is there a way to append identity.pub to
| > | hostname1:/home/username/.ssh/authorized_keys using scp or does this
| > | necessitate using vi and a temporary file ?
| 
| > ssh -l user hostname1 'cat >>/home/username/.ssh/authorized_keys'
| 
|       Just to pick a nit or two...
| 
|       I they couldn't have figured this one out for themselves, should
| you also point out that they need to cat their identity.pub files into
| the ssh command, like this:
| 
|       cat ~/.ssh/identity.pub | \
|       ssh -l user hostname1 'cat >> ~/.ssh/authorized_keys'

Doh, yeah.

But I see thie above a lot. It is poor form to go
        cat file | command
when
        command < file
is simpler and faster. (Since we're picking nits...)

|       BTW...  Use ~/ instead of /home/username just in case their
| home directory is NOT in /home (like root).

No no no no no!

1: I deliberately used the full path because the example had (I assumed that
   /home/username was somehow different since "username" and "user" were
   different strings).

2: Just say:
      ssh -l user hostname1 'cat >> .ssh/authorized_keys' <~/.ssh/identity.pub
    if the path is w.r.t to their home dir because ssh will run from
    there.  Simpler.

3: "~" is NOT PORTABLE.
   Use $HOME if you want this to work in all shells instead of just things
   like bash.
   ~/ is just dandy for the interactive command line if your shell
   supports it (many do). But DO NOT use it in scripts (which generally
   includes commands passed via ssh to some remote host). It assumes
   special knowledge about the far end, and will break on you one day
   if you let your fingers learn such habits.

Cheers,
-- 
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

Once a Junior Programmer interrupted a Great Guru of the Sun to ask a
Question of no importance. The Great Guru replied in words which the Junior
Programmer did not understand. The Junior Programmer sought to rephrase the
Question, saying, "Stop me if I appear stupid." The great Guru, without
speaking, reached over and pressed L1-A.
The Junior Programmer achieved Enlightenment.   - Jon Green


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to