아래 코드를 통해

 

/home/eyeballs/file.txt 을 

eyeballs@sftp.server.com 내 my/path 에 전송한다.

 


#!/bin/bash

sftp -i /home/eyeballs/.ssh/id_rsa eyeballs@sftp.server.com << EOF

  mkdir my/path
  cd my/path
  put /home/eyeballs/file.txt

quit
EOF

 

참고 

https://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4%EC%97%90%EC%84%9C_SFTP%EB%A1%9C_%ED%8C%8C%EC%9D%BC_%EC%98%AC%EB%A6%AC%EA%B8%B0

 

+ Recent posts