Differences
This shows you the differences between the selected revisions of the page.
2019-06-19 | 2019-06-19 | ||
witj .txt (125.22.91.98) (hidden) (untrusted) | Restored revision 1559047159. Undoing revision 1560924602. (martin) (hidden) | ||
Line 130: | Line 130: | ||
Learn about ''[[executables|winscp.com]]'', the console interface tool. | Learn about ''[[executables|winscp.com]]'', the console interface tool. | ||
- | # Connect | + | ===== [[hostkey]] Verifying the Host Key or Certificate in Script ===== |
- | open sftp://sapefi:Spe$f694@172.17.1.36/ -hostkey="ssh-rsa 2048 xxxxxxxxxxx...=" | + | The first connection to an SSH server requires [[ssh_verifying_the_host_key|verification of the host key]]. To automate the verification in script, use ''[[scriptcommand_open#hostkey|-hostkey]]'' switch of ''[[scriptcommand_open|open]]'' command to accept the expected host key automatically. |
- | # Change remote directory | + | |
- | cd /home/user | + | You can find the key fingerprint on [[ui_fsinfo|Server and Protocol Information Dialog]]. You can also copy the key fingerprint to clipboard from the [[ssh_verifying_the_host_key|confirmation prompt]] on the first (interactive) connection using //Copy key fingerprints to clipboard// command (in the script, use SHA-256 fingerprint of the host key only). //Learn more about [[faq_hostkey|obtaining host key fingerprint]]//. |
- | # Download file to the local directory d:\ | + | |
- | get examplefile.txt d:\ | + | FTPS/WebDAVS [[tls#certificate|TLS/SSL certificate]] signed by untrusted authority may also need to be verified. To automate the verification in script, use ''[[scriptcommand_open#certificate|-certificate]]'' switch of ''[[scriptcommand_open|open]]'' command to accept the expected certificate automatically. |
- | # Disconnect | + | |
- | close | + | |
- | # Connect as a different user | + | |
- | open sftp://sapefi:Spe$f694@sftp2.manipalgroup.info/ | + | |
- | # Change the remote directory | + | |
- | cd /home/user2 | + | |
- | # Upload the file to current working directory | + | |
- | put d:\examplefile.txt | + | |
- | # Disconnect | + | |
- | close | + | |
- | # Exit WinSCP | + | |
- | exit | + | |