Ask Ubuntu Asked on December 27, 2021
I would like to transfer my data from one cluster to another. for that, I know that I can write on the command line:
scp -r Folder1 [email protected]:/work/myname
However, I would like to submit a job (qsub) via a batch file. When I write the command line on the terminal, the password is asked. Is there any way to put the password in the batch file and automate the job ?
The correct way is to generate a ssh key like:
ssh-keygen -t rsa -C "[email protected]"
on your host machine and copy the content of ~/.ssh/id_rsa.pub
and lastly add it to the remote machines ~/.ssh/authorized_keys
make sure remote machine have the permissions 0700 for ~./ssh folder
and 0600 for ~/.ssh/authorized_keys
.
This way you won't need to enter password everytime.
Reference: How to pass password to scp
Answered by kashish on December 27, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP