John Mort wrote: > My uncle has a server that I want to scp files to on a regular basis. > He generated a public and private key, and gave me both. Normally I > have to reference the private key manually with the scp command in > order to upload something, but I understand there is a way to add this > to my known_hosts file so that I don't have to manually reference it > every time. I can't find any information on how to do this though, > all the instructions I find talk about how to generate your own > keypair. Since I already have this keypair, does anyone know how to > do this? >
There are a number of ways that ssh allows you to manage authentication and authorization that can be useful for automation, each has it's trade offs. The 2 most common methods are: 1 - it is possible to create a private key with a null passphrase, I would always restrict the use of this in the authorized key file on the target system as tightly as I can. You can restrict the use of a key to just being able to run one command in the authorized_keys file on the target system, see the man page for sshd. 2 - run the ssh-agent and give it your private key, it will respond to all passphrase prompts for you. I generally find the 2nd choice to be best, but it is better to use a null passphrase and limit it's use than store a passphrase or password in a script :-). Jim
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mid-Hudson Valley Linux Users Group http://mhvlug.org http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug Upcoming Meetings (6pm - 8pm) MHVLS Auditorium Feb 6 - DBUS Mar 5 - Setting up a platform-independent home/small office network using Linux
