2023年8月2日 星期三

如何將密碼傳遞給scp? (How to pass password to scp?

 https://tw.coderbridge.com/questions/2ab8f02fd9804d7198ab1d7578ae7454

 

我使用其中方法2:

just generate a ssh key like:

ssh‑keygen ‑t rsa ‑C "your_email@youremail.com"

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