2016-01-16 08:15:50 +00:00
|
|
|
# sftp
|
|
|
|
|
2016-01-31 10:36:32 +00:00
|
|
|
> Secure File Transfer Program.
|
|
|
|
> Interactive program to copy files between hosts over SSH.
|
|
|
|
> For non-interactive file transfers, see `scp` or `rsync`.
|
2016-01-16 08:15:50 +00:00
|
|
|
|
|
|
|
- Connect to a remote server and enter an interactive command mode:
|
|
|
|
|
|
|
|
`sftp {{remote_user}}@{{remote_host}}`
|
|
|
|
|
|
|
|
- Connect using an alternate port:
|
|
|
|
|
2016-01-31 10:36:32 +00:00
|
|
|
`sftp -P {{remote_port}} {{remote_user}}@{{remote_host}}`
|
2016-01-16 08:15:50 +00:00
|
|
|
|
2016-01-31 10:36:32 +00:00
|
|
|
- Transfer remote file to the local system:
|
2016-01-16 08:15:50 +00:00
|
|
|
|
2016-01-31 10:36:32 +00:00
|
|
|
`get {{/path/remote_file}}`
|
2016-01-16 08:15:50 +00:00
|
|
|
|
2016-01-31 10:36:32 +00:00
|
|
|
- Transfer local file to the remote system:
|
2016-01-16 08:15:50 +00:00
|
|
|
|
2016-01-31 10:36:32 +00:00
|
|
|
`put {{/path/local_file}}`
|
|
|
|
|
|
|
|
- Get list of files on local machine:
|
|
|
|
|
|
|
|
`lls`
|
|
|
|
|
|
|
|
- Get list of files on remote machine:
|
|
|
|
|
|
|
|
`ls`
|