What are the exit statuses of ssh command?

www.laut‮t‬uri.com
What are the exit statuses of ssh command?

The ssh command is a command-line utility for connecting to and interacting with remote servers using the Secure Shell (SSH) protocol. When ssh is run, it will return an exit status to indicate the success or failure of the command.

The exit status of the ssh command is a numerical value that represents the result of the command. The following are some common exit statuses of the ssh command:

  • 0: Success. The ssh command was successful and the connection to the remote server was established.

  • 1: Error. An error occurred while trying to establish the connection to the remote server. This could be due to a problem with the network, the server, or the client.

  • 255: Connection refused. The remote server refused the connection. This could be due to a problem with the server or the client, or the server may not be running the SSH service.

  • 256: Connection closed. The connection to the remote server was closed before the ssh command completed. This could be due to a problem with the network, the server, or the client.

  • 257: Protocol error. An error occurred while negotiating the SSH protocol with the remote server. This could be due to a problem with the server or the client, or the server may not be running the SSH service.

You can find more information about the ssh command and its exit statuses in the ssh man page by running man ssh in a terminal.

Created Time:2017-10-30 14:27:32  Author:lautturi