Secure Shell (SSH, SCP, and SFTP) Return Codes in Windows

  • 7021996
  • 01-Feb-2008
  • 02-Mar-2018

Environment

Reflection for Secure IT Windows Client version 7.0 or higher
Reflection Windows-based Products version 14.0 SP4 or higher

Situation

This technical note lists the exit or error codes for Reflection command line utilities SSH, SCP, and SFTP in Windows. Note: This information does not apply to ssh2, scp2, or sftp2.

For a list of SSH or SCP return codes that apply to earlier Reflection versions, see KB 7021696.

For a list of Secure Shell return codes in UNIX, see KB 7021956.

Resolution

To display the return code: Use echo %errorlevel% to display the return code after executing an SSH, SCP, or SFTP command.

Secure Shell Exit Codes

0
Operation Was Successful
65
Host Not Allowed To Connect
66
Protocol Error
67
Key Exchange Failed
68
Reserved
69
MAC Error
70
Compression Error
71
Service Not Available
72
Protocol Version Not Supported
73
Host Key Not Verifiable
74
Connection Lost
75
By Application
76
Too Many Connections
77
Authentication Cancelled By User
78
No More Authentication Methods Available
79
Illegal User Name

Attachmate-defined Error Exit Codes

80
FIPS Critical
81
Invalid FIPS Settings
82
Invalid Password
83
User Authentication Failed
84
Connect Timeout
85
Internal Error
86
Authentication Cancelled By User
87
Connect Failed
88
FIPS Error
89
Connection In Progress
90
Already Connected
91
Com Attach Denied
92
Invalid Argument
93
No Session
94
General Failure
95
Bad Command Line
96
Invalid Windows Credentials
97
Cancel
98
Missing Host
99
Connection Closed By Remote Host
100
New Password Failed
101
Exec Request Error
102
Shell Request Error
103
Fatal Option Error
104
FTP Subsystem Not Avail
105
Windows
106
Winsock
107
Host Key Verify Failed
108
Server Cert Path Validation Failed
109
Server Cert Host Name Check Failed
110
Server Cert Purpose Check Failed
111
Host Key Different
112
No Key Exchange Algorithm
113
Key Exchange Failed
114
No Matching MAC Found
115
Unsupported MAC
116
No Matching Cipher Found
117
Unsupported Cipher
118
No Client (Added in 7.1)
119
ID Exchange Failed (Added in 7.1)
120
Cipher Init Failed (Added in 7.1)
121
Proxy Failed To Find Host (Added in 7.1)

SFTP/SCP Exit Codes

Source: http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/

0
Operation Was Successful
1
EOF
2
No Such File
3
Permission Denied
4
Failure
5
Bad Message
6
No Connection
7
Connection Lost
8
Op Unsupported
9
Invalid Handle
10
No Such Path
11
File Already Exists
12
Write Protect
13
No Media
14
No Space On File System
15
Quota Exceeded
16
Unknown Principal
17
Lock Conflict
18
Dir Not Empty
19
Not A Directory
20
Invalid Filename
21
Link Loop
22
Cannot Delete
23
Invalid Parameter
24
File Is A Directory
25
Byte Range Lock Conflict
26
Byte Range Lock Refused
27
Delete Pending
28
File Corrupt
29
Owner Invalid
30
Group Invalid

Attachmate-defined SFTP/SCP Error Codes

40
Windows User Not Defined
41
No Match
42
Protocol Error
43
Windows
44
Quit
45
No Browse Perm (Added in 7.1)
46
No Download Perm (Added in 7.1)
47
No Upload Perm (Added in 7.1)
48
No Rename Perm (Added in 7.1)
49
No Delete Perm (Added in 7.1)

Channel Open Connection Failure Codes

193
Administratively Prohibited
194
Connect Failed
195
Unknown Channel Type
196
Resource Shortage

Remote Command Exit Code

A zero (0) exit code usually means that the remote command terminated successfully. Otherwise, the exit code will be the value of the exit code from the remote server. Note: If the remote server runs on UNIX and the exit on the server side is due to a signal, the exit code will be 128 + the value of the exit code from the remote server.

Additional Information

Legacy KB ID

This document was originally published as Attachmate Technical Note 2285.