Skip to content

Commit e8331b2

Browse files
committed
More file transfer docs
1 parent 1a92f99 commit e8331b2

File tree

1 file changed

+56
-3
lines changed

1 file changed

+56
-3
lines changed

docs/kittens/transfer.rst

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,64 @@ large files and to automatically resume interrupted transfers.
1919
.. seealso:: See the :doc:`remote_file` kitten
2020

2121
.. note::
22-
This kitten (which practically means kitty) must be installed on the remote
23-
machine. If that is not possible you can use the :doc:`remote_file` kitten
24-
instead. Or write your own script to use the underlying file transfer
22+
This kitten (which practically means kitty) must be installed on the other
23+
machine as well. If that is not possible you can use the :doc:`remote_file`
24+
kitten instead. Or write your own script to use the underlying file transfer
2525
protocol.
2626

27+
28+
Basic usage
29+
---------------
30+
31+
In what follows, the *local computer* is the computer running this kitten and
32+
the *remote computer* is the computer connected to the other end of the TTY pipe.
33+
34+
To send a file from the local computer to the remote computer, simply run::
35+
36+
kitty +kitten transfer /path/to/local/file /path/to/destination/on/remote/computer
37+
38+
You will be prompted by kitty for confirmation on allowing the transfer, and if
39+
you grant permission, the file will be copied.
40+
41+
Similarly, to get a file from the remote computer to the local computer, use
42+
the :option:`kitty +kitten transfer --direction` option::
43+
44+
kitty +kitten transfer --direction=receive /path/to/remote/file /path/to/destination/on/local/computer
45+
46+
Multiple files and even directories can be transferred::
47+
48+
kitty +kitten transfer file1 dir1 destination/
49+
50+
Here :file:`file1` will be copied inside :file:`destination` and :file:`dir1`
51+
will be recursively copied into :file:`destination`. Note the trailing slash on
52+
:file:`destination`. This tells kitty the destination is a directory. While not
53+
strictly necessary (kitty will infer the need for a destination directory from
54+
the fact that you are copying multiple things) it is good practice to always
55+
use a trailing slash when the destination is supposed to be a directory.
56+
57+
58+
Avoiding the confirmation prompt
59+
------------------------------------
60+
61+
Normally, when you start a file transfer kitty will prompt you for
62+
confirmation. This is to ensure that hostile programs running on a remote
63+
machine cannot read/write files on your computer without your permission.
64+
If the remote machine is trusted and the connection between your computer
65+
and the remote machine is secure, then you can disable the confirmation prompt
66+
by:
67+
68+
#. Setting the :opt:`file_transfer_confirmation_bypass` option to some
69+
password.
70+
71+
#. When invoking the kitten use the :option:`kitty +kitten transfer --permissions-bypass`
72+
to supply the password you set in step one.
73+
74+
.. warning:: Using a password to bypass confirmation means any software running
75+
on the remote machine could potentially learn that password and use it to
76+
gain full access to your computer. Also anyone that can intercept the data
77+
stream between your computer and the remote machine can also learn this
78+
password. So use it only with secure connections to trusted computers.
79+
2780
.. versionadded:: 0.24.0
2881

2982
.. include:: ../generated/cli-kitten-transfer.rst

0 commit comments

Comments
 (0)