Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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)

share|improve this question

2 Answers 2

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

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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