mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
SSH认证--私钥认证方式增加用户名选项
This commit is contained in:
@@ -42,6 +42,9 @@ func (this *CreateAction) RunPost(params struct {
|
||||
this.FailField("username", "请输入SSH登录用户名")
|
||||
}
|
||||
case "privateKey":
|
||||
if len(params.Username) == 0 {
|
||||
this.FailField("username", "请输入SSH登录用户名")
|
||||
}
|
||||
if len(params.PrivateKey) == 0 {
|
||||
this.FailField("privateKey", "请输入RSA私钥")
|
||||
}
|
||||
|
||||
@@ -74,6 +74,9 @@ func (this *UpdateAction) RunPost(params struct {
|
||||
this.FailField("username", "请输入SSH登录用户名")
|
||||
}
|
||||
case "privateKey":
|
||||
if len(params.Username) == 0 {
|
||||
this.FailField("username", "请输入SSH登录用户名")
|
||||
}
|
||||
if len(params.PrivateKey) == 0 {
|
||||
this.FailField("privateKey", "请输入RSA私钥")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user