feat: ssh支持免认证连接

This commit is contained in:
TsMask
2024-04-11 21:04:24 +08:00
parent 0b8d0781a2
commit 507a1690bd
4 changed files with 55 additions and 28 deletions

View File

@@ -11,7 +11,7 @@ type NeHost struct {
Addr string `json:"addr" gorm:"column:addr" binding:"required"` // 主机地址
Port int64 `json:"port" gorm:"column:port" binding:"required,number,max=65535,min=1"` // SSH端口
User string `json:"user" gorm:"column:user" binding:"required"` // 主机用户名
AuthMode string `json:"authMode" gorm:"column:auth_mode" binding:"oneof=0 1"` // 认证模式0密码 1主机私钥
AuthMode string `json:"authMode" gorm:"column:auth_mode" binding:"oneof=0 1 2"` // 认证模式0密码 1主机私钥 2已免密
Password string `json:"password" gorm:"column:password"` // 认证密码
PrivateKey string `json:"privateKey" gorm:"column:private_key"` // 认证私钥
PassPhrase string `json:"passPhrase" gorm:"column:pass_phrase"` // 认证私钥密码