2011年7月7日 星期四

ftp auto login

在 home directory 創建 .netrc 檔案, 權限 0600
內容:
machine [remote_ftp_server]
login [username]
password [password]

則我們在 ftp [remote_ftp_server] 時會自動 Login.

如果還要再接下來自動執行 ftp 命令.
則先把需要的命令順序寫到一個檔案中.
再將檔案指定給 ftp 即可.

example:
create test.list
> ls
> exit

ftp 192.168.1.1 < test.list

沒有留言: