I am manually carrying out a series of files which involves generating files on my local machine and then copying them over to a remote machine.

Currently, I use scp and ssh to perform these tasks. At the moment, eash time I want to ssh into the remote machine, or do a scp, I am (quite rightly), prompted for a password. However, I want to automate the tasks into one script that I can setup to run with cron.

I have seen insecure solutions to this problem, which involve setting the PASSWORD in an environment variable. I am not comfortable with that. Can someone suggest another, more secure way of automating a script that uses ssh and scp?.

BTW, both my local machine and remote machine are running Linux (Ubuntu)

link|improve this question

70% accept rate
feedback

2 Answers

Set up authentication key so ssh will not prompt you for a password. e.g. O'Reilly book or Debian You store your public key on the servers and then the private key on the clients

link|improve this answer
feedback

Use public key authentication. There's an Ubuntu-specific tutorial here:

https://help.ubuntu.com/community/SSH/OpenSSH/Keys

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.