Grsync password1/31/2024 The following line will login (with user "ross", for which we just setup password-less ssh logins) and rsync the home directory on my source machine with a backup directory on the destination machine ("kids"): Make a backup script (mine's in my home directory, but it could be anywhere):Įnter the rsync options and paths into the new file. No password required (this is actually a small security risk, but it has a big payoff - see next step.Ħ. If it works, it will work every time for all ssh connections for that user. This (with your correct username and hostname/ip address) should get you in to the destination machine. Logout of the destination machine and try getting back in without the password: You should be logged in to the remote machine, and you should (might) see a test message about confirming the setup.ĥ. Warning: Permanently added '.' (RSA) to the list of known password: The authenticity of host '.' can't be established.Īre you sure you want to continue connecting (yes/no)? If you already tested ssh as in step 2 above, you'll simply be asked for the passphrase. Copy the public key to the destination ssh-copy-id -i ~/.ssh/id_dsa.pub Your public key has been saved in /home/rick/.ssh/id_dsa.pub.Ĥ. Your identification has been saved in /home/ross/.ssh/id_dsa. Enter passphrase (empty for no passphrase): Enter file in which to save the key (/home/ross/.ssh/id_dsa): This will yield the id_dsa.pub and id_dsa files (the public and private key pair): Setup public/private key ssh-keygen -t dsaįollow the prompts, just hitting enter for the passphrase. Type "exit" to return to the source machine.ģ. If it doesn't use google to search for the error message. (If you are logging on as another user, you can type the username before the host, i.e.: ssh good so far. For above, it would be "ssh kids", or whatever your hostname/ip is.)Įnter the password. (I will show my full prompt several times in this tutorial, but obviously you just enter the last part. For me, the destination machine is called kids This is the password for the user on the destination machine, not the local password (in my case, they're the same). As user ("ross" in my case - not root) try to login to the destination machine using ssh, specifying either an ip address or a hostname (if the hostname appears in /etc/hosts). So this little tutorial is as much to help me remember (and to keep a record and to trace the steps) as for other users.Ī) ssh (should be installed by default) and rsync ("sudo apt-get install rsync" if you don't already have it).ī) Users on both machines (the source machine and the destination machine), ideally with the same username (so: if user "ross" exists on source machine, user "ross" should also exist on destination machine).Ĭ) ssh and rsync installed on both machines. Several times I've had to configure automated backups for my machines, and each time I do, a long enough period has elapsed since the previous time that I forget all the important details.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |