The server selects from one of the methods given in METHODS, and
sends a METHOD selection message:
+----+--------+
|VER | METHOD |
+----+--------+
| 1 | 1 |
+----+--------+
If the selected METHOD is X'FF', none of the methods listed by the
client are acceptable, and the client MUST close the connection.
The values currently defined for METHOD are:
o X'00' NO AUTHENTICATION REQUIRED ---------无用户密码 00
o X'01' GSSAPI ---------??? GSSAPI ?
o X'02' USERNAME/PASSWORD ---------有用户密码 02
o X'03' to X'7F' IANA ASSIGNED
o X'80' to X'FE' RESERVED FOR PRIVATE METHODS
o X'FF' NO ACCEPTABLE METHODS ---------失败 255
The client and server then enter a method-specific sub-negotiation.
换言之,就是向服务器发送三个字节的Byte数组,由于是无须用户/密码校验,展开来写是 05 01 00
然后服务器返回两个字节的信息,第一个字节固定,第而个字节是说明,如果是16进制的FF(即十进制255)表示连接失败(o X'FF' NO ACCEPTABLE METHODS)根据上面的列表,我们连接成功应该第二字节为 00.
然后我们进入第二步,请看以下RFC说明: