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.
ssh
has been run at least once on each machine. This will set up some needed directories and files.root
, run the ssh-keygen -t rsa
command. This will create the file id_rsa.pub
in the /root/.ssh
directory.scp
to copy that file to M2 to the /tmp
directory (or some other suitable location).home/guest1/.ssh directory
.authorized_keys
file edit it, otherwise create it./tmp/id_rsa.pub
file into the authorized_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. If there are any problems remember that this has to be set up for each user that wants to perform unattended ssh
/scp
.
If you have an Internet service provider (ISP) that provides SSH with your account this method should work on there as well. I use it all the time and it is really convenient. Using this approach you can have a script generate an HTML file and then copy it right to your website. Dynamic generation of HTML pages is something programs are really good at.