To setup public key Authentication
Whenever you need to use scp to copy files, it asks for passwords. Same with rsync as it (by default) uses ssh as well. Usually scp and rsync commands are used to transfer or backup files between known hosts or by the same user on both the hosts. It can get really annoying the password is asked every time. I even had the idea of writing an expect script to provide the password. Of course, I didn’t. Instead I browsed for a solution and found it after quite some time. There are already a couple of links out there which talk about it. I am adding to it…
Lets say you want to copy between two hosts host_src and host_dest. host_src is the host where you would run the scp, ssh or rsyn command, irrespective of the direction of the file copy!
- On host_src, run this command as the user that runs scp/ssh/rsync
$ ssh-keygen -t rsa
This will prompt for a passphrase. Just press the enter key. It’ll then generate an identification (private key) and a public key. Do not ever share the private key with anyone! ssh-keygen shows where it saved the public key. This is by default ~/.ssh/id_rsa.pub:
Your public key has been saved in <your_home_dir>/.ssh/id_rsa.pub.
- Transfer the id_rsa.pub file to host_dest by either ftp, scp, rsync or any other method.
- On host_dest, login as the remote user which you plan to use when you run scp, ssh or rsync on host_src.
- Copy the contents of id_rsa.pub to ~/.ssh/authorized_keys
$ cat id_rsa.pub >>~/.ssh/authorized_keys
$ chmod 700 ~/.ssh/authorized_keys
If this file does not exist, then the above command will create it. Make sure you remove permission for others to read this file. If its a public key, why prevent others from reading this file? Probably, the owner of the key has distributed it to a few trusted users and has not placed any additional security measures to check if its really a trusted user.
- Note that ssh by default does not allow root to log in. This has to be explicitly enabled on host_dest. This can be done by editing /etc/ssh/sshd_config and changing the option of PermitRootLogin from no to yes. Don’t forget to restart sshd so that it reads the modified config file. Do this only if you want to use the root login.
Tags: linux, Public Key Authentication

542l2U jwqnqrjxqzay, [url=http://miuelxwlwezp.com/]miuelxwlwezp[/url], [link=http://fbbkthzhxaac.com/]fbbkthzhxaac[/link], http://csinrlocwekb.com/
Breitling Watches is considered a high frequency movement at 28,800 vibrations per hour. The new Superocean features this new movement, and encases Chrono Superocean beautifully in stainless Breitling Avenger steel, steel & gold, or 18k rose gold.
If you are going to buy ED clothing from major retail shops and fashion stores, always check the standard of the fabric. ED Hardy Shoes is made from top quality material and with a straightforward touch you will be able to identify an hardy shirt . You have to check also the published design on the shirt. hardy shirts prints are perfectly embossed on the shirt. The revealed
Hogan scarpe casual collection consists of running, action sports, sports culture, swim and some sports. Man Hogan scarpe donna are built to handle every variety of weather and terrain, and hogan donna features metal hardware for a traditional look. A durable solid rubber Hogan scarpe uomo outsole compound and lug pattern ensures maximum traction over turf and terrain.