문제

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