Forrest logo
back to the AUTOSSH_DEBUG=1 tool

autossh:tldr:eac8e

autossh: Run in the background, logging `autossh` debug output and `ssh` verbose output to files.
$ AUTOSSH_DEBUG=1 AUTOSSH_LOGFILE=${path-to-autossh_log_file-log} autossh -f -M ${monitor_port} -v -E ${path-to-ssh_log_file-log} ${ssh_command}
try on your machine

This command runs the autossh program with several options and environment variables set. Here's what each part of the command does:

  • AUTOSSH_DEBUG=1 sets the AUTOSSH_DEBUG environment variable to 1, which enables debug mode for autossh. This will provide more detailed output for troubleshooting purposes.

  • AUTOSSH_LOGFILE=${path-to-autossh_log_file.log} sets the AUTOSSH_LOGFILE environment variable to the specified path, which determines the location and name of the log file for autossh to write its logs. ${path-to-autossh_log_file.log} should be replaced with the actual file path.

  • autossh is the command that runs the autossh program.

  • -f runs autossh in the background (in the foreground by default), allowing it to detach from the terminal and continue executing even if the terminal is closed.

  • -M ${monitor_port} specifies the monitor port for autossh. The monitor port is used to send keep-alive messages to the remote SSH server to maintain the SSH connection. ${monitor_port} should be replaced with the actual port number.

  • -v enables verbose mode for autossh, providing additional information and debugging output during its execution.

  • -E ${path-to-ssh_log_file.log} sets the log file path for SSH client log messages. ${path-to-ssh_log_file.log} should be replaced with the actual file path. This log file will contain the log messages generated by the underlying SSH client that autossh uses.

  • ${ssh_command} represents the SSH command to be executed by autossh. It should be replaced with the actual SSH command that autossh will run to establish and maintain the SSH connection.

Overall, this command sets up autossh with debug mode enabled, specifies log files for autossh and ssh client logs, and runs autossh in the background with verbose output. It also specifies the monitor port and the SSH command to be executed.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the AUTOSSH_DEBUG=1 tool