سؤال

I can copy files with scp that way:

scp file pavel@host:~/

but I have to enter 2 passwords

Enter passphrase for key '/home/pavel/.ssh/id_rsa':
pavel@host's password:

How can I put such command in crontab (enter passwords automatically)?

هل كانت مفيدة؟

المحلول

You can put it in a crontab if you follow these steps:

Problem message: pavel@host's password:

Solution: make sure that your public key was added to the authorized_keys file on the remote host, meaning make key based login at least working.

Problem message: Enter passphrase for key '/home/pavel/.ssh/id_rsa':

Solution: replace the password from the private key

The latter action of course introduces a lack of security, but there is no way around if you want to fully automate this.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top