transfer.rst 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Transfer files
  2. ================
  3. .. only:: man
  4. Overview
  5. --------------
  6. .. versionadded:: 0.30.0
  7. .. _rsync: https://en.wikipedia.org/wiki/Rsync
  8. Transfer files to and from remote computers over the ``TTY`` device itself.
  9. This means that file transfer works over nested SSH sessions, serial links,
  10. etc. Anywhere you have a terminal device, you can transfer files.
  11. .. image:: ../screenshots/transfer.png
  12. :alt: The transfer kitten at work
  13. This kitten supports transferring entire directory trees, preserving soft and
  14. hard links, file permissions, times, etc. It even supports the rsync_ protocol
  15. to transfer only changes to large files.
  16. .. seealso:: See the :doc:`remote_file` kitten
  17. Basic usage
  18. ---------------
  19. Simply ssh into a remote computer using the :doc:`ssh kitten </kittens/ssh>` and run the this kitten
  20. (which the ssh kitten makes available for you on the remote computer
  21. automatically). Some illustrative examples are below. To copy a file from a
  22. remote computer::
  23. <local computer> $ kitten ssh my-remote-computer
  24. <remote computer> $ kitten transfer some-file /path/on/local/computer
  25. This, will copy :file:`some-file` from the computer into which you have SSHed
  26. to your local computer at :file:`/path/on/local/computer`. kitty will ask you
  27. for confirmation before allowing the transfer, so that the file transfer
  28. protocol cannot be abused to read/write files on your computer.
  29. To copy a file from your local computer to the remote computer::
  30. <local computer> $ kitten ssh my-remote-computer
  31. <remote computer> $ kitten transfer --direction=upload /path/on/local/computer remote-file
  32. For more detailed usage examples, see the command line interface section below.
  33. .. note::
  34. If you dont want to use the ssh kitten, you can install the kitten binary on
  35. the remote machine yourself, it is a standalone, statically compiled binary
  36. available from the `kitty releases page
  37. <https://github.com/kovidgoyal/kitty/releases>`__. Or you can write your own
  38. script/program to use the underlying :doc:`file transfer protocol
  39. </file-transfer-protocol>`.
  40. Avoiding the confirmation prompt
  41. ------------------------------------
  42. Normally, when you start a file transfer kitty will prompt you for confirmation.
  43. This is to ensure that hostile programs running on a remote machine cannot
  44. read/write files on your computer without your permission. If the remote machine
  45. is trusted, then you can disable the confirmation prompt by:
  46. #. Setting the :opt:`file_transfer_confirmation_bypass` option to some password.
  47. #. When invoking the kitten use the :option:`--permissions-bypass
  48. <kitty +kitten transfer --permissions-bypass>` to supply the password you set
  49. in step one.
  50. .. warning:: Using a password to bypass confirmation means any software running
  51. on the remote machine could potentially learn that password and use it to
  52. gain full access to your computer.
  53. Delta transfers
  54. -----------------------------------
  55. This kitten has the ability to use the rsync_ protocol to only transfer the
  56. differences between files. To turn it on use the :option:`--transmit-deltas
  57. <kitty +kitten transfer --transmit-deltas>` option. Note that this will
  58. actually be slower when transferring small files or on a very fast network, because
  59. of round trip overhead, so use with care.
  60. .. include:: ../generated/cli-kitten-transfer.rst