Is it possible to to connect two servers through sftp with a batch of commands and where the authenticating password needs to be read from a file (where it is stored previously)? I am new in the UNIX world, please help me on this.
Asked
Active
Viewed 3,297 times
0
-
1Use `expect` http://www.linux-bsd-central.com/index.php/content/view/26/29/ – jijinp Jul 22 '15 at 13:12
1 Answers
1
You can also use password less connections, just use public/private key and you are ready to go.
Using lftp client you can establish connections giving username/password as a parameter in the command line lftp sftp://sftp_server -uuser,password
YoMismo
- 4,005
- 1
- 15
- 31
-
While not answering the question per se, it is what the OP should be doing as `expect` is just crazy when you can use keys – gwillie Jul 23 '15 at 01:51
-
@gwillie the question was answered in the previous answer. Reason for me to start with "You can **also** use...". Anyway, `lftp` parameters can be read from a batch file and that may answer the question with a different solution than the previous one. – YoMismo Jul 23 '15 at 06:26