ssh and scp
Using scp
to a remote computer is a really good idea too and my backup program does that every night as well. Here is how to set up unattended ssh
/scp
. In this case, the root account on machine 1 (M1) will be able to scp
files to the guest1
account on machine 2 (M2). I do it this way because I always disable root access of ssh
/scp
for security reasons on all my machines.
First make sure
ssh
has been run at least once on each machine. This will set up some needed directories and files.On M1, under
root
, run thessh-keygen -t rsa
command. This will create the fileid_rsa.pub
in the/root/.ssh
directory.Use
scp
to copy that file to M2 to the/tmp
directory (or some other suitable location).On M2 go to the /
home/guest1/.ssh directory
.If there is already an
authorized_keys
file edit it, otherwise create it.Copy the line in the
/tmp/id_rsa.pub
file into theauthorized_keys
file and save it.
Test this by using scp
to copy a file from M1 to M2. It should work without prompting for a password...