如何用shell script輸入密碼 - Linux

Table of Contents

※ 引述《ADORIAN ()》之銘言:
: 各位好, 我是linux初學者, 需要用到shell script
: 我的目的是將電腦IP為IP1所在的資料Jump.cpp
: 傳到現在正在使用IP為IP2的PC中. 傳輸檔案很多個
: 所以我用shell script寫了很多行的scp指令(如下)
: scp IP1:/home/user/Jump.cpp /home/user/RJMCMC/
: 但每一次執行scp都會要我輸入IP1的密碼
: 請問有沒有辨法可將密碼輸入script中, 使shell
: 自行輸入, 不用每次叫一次scp指令都要手動輸入一次
: 或者有沒有別的方法也適用上述情況
: 謝謝!

http://sial.org/howto/openssh/publickey-auth/

OpenSSH Public Key Authentication

相信我, 用了這個以後 所有 SSH 相關的東西都會變得很輕鬆。



--

All Comments

Jacky avatarJacky2009-01-03
謝謝, 我研究看看~