2008-11-15, 12:40 AM
I want to be able to write a script to basically back up files from other servers. I've got it working from perl grabbing these files without having to ask for password (by using the rsa public/private key I generated and automatically accepting any connection to any foreign host). But what I'm having problems figuring out how to do is only allowing this key pair to issue the scp command (meaning if someone tries to connect to the other servers from the server with the private key it should ask for a password since it cant use the public key on the other server to authenticate ssh since that public key only allows scp usage).
Google doesn't seem to be helping much, only get guides on how to generate the key pairs (god is there enough of them?) and I seem to be incapable of finding out how to put limits on the public key (though this could be because I don't know what specifically I'm looking for). I've made some progress, adding command="scp" to the begging of the key does prevent ssh from working but it also breaks scp (basically it looks like the command "scp" was entered without anything else, not the command my perl script was trying to issue against it).
Any help would be greatly appreciated, even if it is only a link to a detailed tutorial of all the little things you can set up in the key file.