[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: scp and scripts?



On Wed, 2005-07-06 at 17:31 -0400, Stephen R Laniel wrote:
> On Wed, Jul 06, 2005 at 03:44:13PM -0400, linux starved wrote:
> > information.  The following is basically what I want the script to do,
> > but I heard scp will not work with authentication.  I also read about
> > rsync and tried to get the following one liner to work on the source
> > server
> 
> To get scp working without prompting you for a password, do
> as follows:
> 
> (Supposing that you're scp'ing files from machine A to
> machine B, and that your username is the same on both A and
> B.)
> 
> 1) run 'ssh-keygen -t dsa' on machine A. This will generate
> an SSH key of the appropriate type. It will ask you if you
> want a passphrase; press enter to use a blank passphrase.
> Accept any other defaults presented to you.
> 
> 2) You will now have a directory ~/.ssh . In there will be
> two files (at least): id_dsa and id_dsa.pub. The latter is a
> public key, the former a private key.
> 
> 3) Copy id_dsa.pub to machine B. To do so, type
> 
> scp ~/.ssh/id_dsa.pub [machine B's name]:

I think using: 

$ ssh-copy-id -i ~/.ssh/id_dsa.pub user@machine

is the "proper" way of doing this. It ensures that the file ends up on
the remote machine with proper permissions set, and adds the appropriate
entry in the remote ~/.ssh/authorized_keys.

-davidc


-- 
gpg-key: http://www.zettazebra.com/files/key.gpg

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: