In the Iterm2 v3.0 version, there is a new Feature--shell integration, the more important function is to replace the traditional "RZ", "sz" (that is, upload to the server, download files)
The specific usage can be found on the website as follows:
Https://iterm2.com/documentation-shell-integration.html
Here are some four things to keep in mind (these four things are the pits I've stepped on)
Note Item One:
Curl-l https://iterm2.com/misc/install_shell_integration.sh | Bash
This command is executed either on the server or natively, or through the "Install Shell Integration", "Iterm2", and after execution, you will find either the server or the native at the command prompt There is a small blue triangular block at the front (when shell integration is enabled, ITerm2 automatically adds a mark at every command prompt. Marks is indicated visually by a small blue triangle on the left margin.)
Note Item Two:
If the server's SSH port is not 22, you need to configure Sshconfig on Mac locally, the configured file name requires special attention.
Official website: https://gitlab.com/gnachman/iterm2/wikis/scp-not-connecting (can be referenced, but not written in detail)
Configure the Sshconfig file of the native (MAC) machine, remember that this file must be! The "~/.ssh/ssh_config" shown on the official website is not possible.
~/.ssh/config
The contents of the configuration, if you want it to be generic, you can write directly (for example, our server port is 2222):
Host * 2222
Note Item Three:
If the server's hostname is not the connected IP address (note: You can use the HOSTNAME-F command to query), you need to do in the Hosts file "hostname" and "IP" of the corresponding relationship , Otherwise this machine is unable to recognize the hostname of the server (in fact, this is also related to the office environment)
/etc/hosts
Note Item Four:
When uploading a file, you need to hold down the "Option" key while dragging the file.
The use and considerations of the Shell integration for Mac artifact Iterm2