[英]SoftEther Authentication "Access denied"
I'm using SoftEther APIs to connect to a VPS and then try to build a VPN on that .我正在使用SoftEther API连接到 VPS,然后尝试在其上构建 VPN。 I can successfully connect to server using IP and Port, then at Authentication step I get "Access denied" and no more details.我可以使用 IP 和端口成功连接到服务器,然后在身份验证步骤我得到“拒绝访问”,没有更多详细信息。 The authentication step is using Password and HubName.身份验证步骤使用密码和 HubName。
I've read the APIs codes deeply and I realized it using SHA0
algorithm to encrypt password and take a random arrays of bytes from server and use that as salt in encrypt method .我已经深入阅读了 API 代码,我意识到它使用SHA0
算法加密密码并从服务器获取随机字节数组并将其用作 encrypt 方法中的盐。 So I've changed the encryption method at SoftEther Application to AES128
, AES256
and some others but the result has not been changed at all.所以我已经将 SoftEther Application 的加密方法更改为AES128
、 AES256
和其他一些,但结果根本没有改变。 I also tried to send password as an ASCII
but none of them worked.我也尝试将密码作为ASCII
发送,但都没有奏效。
The exact API code without change:没有更改的确切 API 代码:
using (var softEther = new SoftEther(ip, port))
{
// the connection step that would pass successfully :
var connectResult = softEther.Connect();
if (!connectResult.Valid())
{
Console.WriteLine(connectResult.Error);
return;
}
// the Authentication step that got problem :
var authResult = softEther.Authenticate(pw, hubName);
if (!authResult.Valid())
{
Console.WriteLine(authResult.Error);
return;
}
// the code stops and don't get here :
var user = softEther.HubApi.GetUser(hubName, userName);
Console.WriteLine(user.Valid() ? "Success" :
user.Error.ToString());
}
And this is the authResult I get这是我得到的authResult
Well since you are working on server side of SoftEther i would recommend you to use VPNCMD for managing or retrieving info from SoftEther server.好吧,既然您在 SoftEther 的服务器端工作,我建议您使用 VPNCMD 来管理或检索来自 SoftEther 服务器的信息。
VPNCMD Virtual Hub commands: https://www.softether.org/4-docs/1-manual/6._Command_Line_Management_Utility_Manual/6.4_VPN_Server_%2F%2F_VPN_Bridge_Management_Command_Reference_(For_Virtual_Hub) VPNCMD 虚拟集线器命令: https ://www.softether.org/4-docs/1-manual/6._Command_Line_Management_Utility_Manual/6.4_VPN_Server_%2F%2F_VPN_Bridge_Management_Command_Reference_(For_Virtual_Hub )
For example enter the following in cmd/terminal:例如在 cmd/terminal 中输入以下内容:
vpncmd /server {serverIP} /PASSWORD:{server password} /adminhub:{server HUB Name} /CMD UserCreate {username} /GROUP:{groupname} /REALNAME:{user fullname} /NOTE:{anything} vpncmd /server {serverIP} /PASSWORD:{server password} /adminhub:{server HUB Name} /CMD UserCreate {username} /GROUP:{groupname} /REALNAME:{user fullname} /NOTE:{anything}
Requirements: Download and install SoftEther server manager for your machine OS(ie from where you want to control remote server)要求:为您的机器操作系统下载并安装 SoftEther 服务器管理器(即从您想要控制远程服务器的位置)
You can also execute VPN Client functions from VPNCMD: https://www.softether.org/4-docs/1-manual/6._Command_Line_Management_Utility_Manual/6.5_VPN_Client_Management_Command_Reference您还可以从 VPNCMD 执行 VPN 客户端功能: https ://www.softether.org/4-docs/1-manual/6._Command_Line_Management_Utility_Manual/6.5_VPN_Client_Management_Command_Reference
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.