The problem is that the error message has to be transferred from the remote end and there are a limited number of status messages. These are defined by the (draft) RFC for the protocol. OpenSSH supports the following:
SSH_FX_OK 0 SSH_FX_EOF 1 SSH_FX_NO_SUCH_FILE 2 SSH_FX_PERMISSION_DENIED 3 SSH_FX_FAILURE 4 SSH_FX_BAD_MESSAGE 5 SSH_FX_NO_CONNECTION 6 SSH_FX_CONNECTION_LOST 7 SSH_FX_OP_UNSUPPORTED 8 It looks like there are more status codes defined by the draft specification(s). For example: SSH_FX_WRITE_PROTECT 12 But that is not currently supported by OpenSSH. I don't know whether there is interest in supporting other sftp v3 error codes in OpenSSH. - todd