Proxmox VE utilizes SSH tunnels for various features.
Proxying console/shell sessions (node and guests)
When using the shell for node B while being connected to node A, connects to a terminal proxy on node A, which is in turn connected to the login shell on node B via a non-interactive SSH tunnel.
VM and CT memory and local-storage migration in secure mode.
During the migration, one or more SSH tunnel(s) are established between the source and target nodes, in order to exchange migration information and transfer memory and disk contents.
.bashrc
and siblingsIn case you have a custom .bashrc
, or similar files that get executed on
login by the configured shell, ssh
will automatically run it once the session
is established successfully. This can cause some unexpected behavior, as those
commands may be executed with root permissions on any of the operations
described above. This can cause possible problematic side-effects!
In order to avoid such complications, it’s recommended to add a check in
/root/.bashrc
to make sure the session is interactive, and only then run
.bashrc
commands.
You can add this snippet at the beginning of your .bashrc
file:
# Early exit if not running interactively to avoid side-effects! case $- in *i*) ;; *) return;; esac