mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-23 18:00:27 +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私钥")
|
||||
}
|
||||
|
||||
@@ -39,6 +39,13 @@
|
||||
|
||||
<!-- 私钥 -->
|
||||
<tbody v-if="method == 'privateKey'">
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RSA私钥 *</td>
|
||||
<td>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{$layout}
|
||||
{$template "grant_menu"}
|
||||
{$template "/code_editor"}
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
@@ -34,10 +35,16 @@
|
||||
|
||||
<!-- 私钥 -->
|
||||
<tbody v-if="grant.method == 'privateKey'">
|
||||
<tr>
|
||||
<td>SSH用户名</td>
|
||||
<td>{{grant.username}}
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RSA私钥</td>
|
||||
<td>
|
||||
{{grant.privateKey}}
|
||||
<source-code-box type="text/plain">{{grant.privateKey}}</source-code-box>
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -42,10 +42,14 @@
|
||||
|
||||
<!-- 私钥 -->
|
||||
<tbody v-if="grant.method == 'privateKey'">
|
||||
<tr>
|
||||
<td>SSH用户名</td>
|
||||
<td>{{grant.username}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RSA私钥</td>
|
||||
<td>
|
||||
{{grant.privateKey}}
|
||||
<pre class="pre-box" style="max-height: 10em; overflow-y: auto">{{grant.privateKey}}</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -40,6 +40,13 @@
|
||||
|
||||
<!-- 私钥 -->
|
||||
<tbody v-if="method == 'privateKey'">
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100" v-model="grant.username"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RSA私钥 *</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user