tldr/pages/common/sftp.md

34 lines
719 B
Markdown
Raw Normal View History

# sftp
> Secure File Transfer Program.
> Interactive program to copy files between hosts over SSH.
> For non-interactive file transfers, see `scp` or `rsync`.
- Connect to a remote server and enter an interactive command mode:
`sftp {{remote_user}}@{{remote_host}}`
- Connect using an alternate port:
`sftp -P {{remote_port}} {{remote_user}}@{{remote_host}}`
- Transfer remote file to the local system:
`get {{/path/remote_file}}`
- Transfer local file to the remote system:
`put {{/path/local_file}}`
2016-04-01 17:47:57 +03:00
- Transfer remote folder to the local system recursively (works with `put` too):
2016-04-01 17:46:33 +03:00
2016-04-01 17:47:57 +03:00
`get -R {{/path/remote_folder}}`
2016-04-01 17:46:33 +03:00
- Get list of files on local machine:
`lls`
- Get list of files on remote machine:
`ls`