TRAMP provides several ways to flush remote connections.
This command flushes all connection related objects. vec is the internal representation of a remote connection. When called interactively, this command lists active remote connections in the minibuffer. Each connection is of the format /method:user@host:. Flushing remote connections also cleans the password cache (see Password handling), file cache, connection cache (see Connection caching), and connection buffers.
Flushes only the current buffer’s remote connection objects, the same
Flushes all active remote connection objects, the same as in
Just as for
tramp-cleanup-all-connections, all remote
connections are cleaned up in addition to killing buffers related to
that remote connection.