feat(remote): 自 go-hua/remote 并入远程控制服务管理

- RDP/VNC(TightVNC)/Radmin 服务状态查询与启停重置、VNC 安装/配置读写/密码
  加解密、GetRemoteInfo 汇总、CAD/SAS 注册表开关
- 与本库 file/shell/process 同属被控端远程运维能力; 新增依赖
  kardianos/service、KarpelesLab/vncpasswd
- 附 remote_test.go 与包 README(含平台支持矩阵与权限注意)
This commit is contained in:
2026-09-20 12:39:30 +08:00
parent d9eb9acd9b
commit 9c2a57b576
9 changed files with 1064 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
//go:build linux
package remote
import "os"
// GetRemoteInfo 获取远程控制相关信息(Linux 平台仅主机名/IP/MAC)
func GetRemoteInfo() Info {
info := Info{}
/*var status int
status, _ = GetRadminServiceStatus()
info.RadminState = status
status, _ = GetVncServiceStatus()
info.VncState = status
status, _ = GetRdpServiceStatus()
info.RdpState = status*/
/* var port int
port, _ = GetRadminPort()
info.RadminPort = port
port, _ = GetRdpPort()
info.RdpPort = port
port, _ = GetVncPort()
info.VncPort = port*/
hostname, _ := os.Hostname()
info.Hostname = hostname
info.IpAddr = getIPs()
info.MacAddr = getMacAddrs()
return info
}
// VncServerDefaultConfig 生成 TightVNC 服务端默认配置(Linux 未实现,返回空配置)
func VncServerDefaultConfig(randPass bool) VncServerConfig {
config := VncServerConfig{}
return config
}
// VncClientDefaultConfig 生成 TightVNC 客户端默认配置(Linux 未实现,返回空配置)
func VncClientDefaultConfig(randPass bool) VncServerConfig {
config := VncServerConfig{}
return config
}
// WriteVncServerConfig 写入 TightVNC 服务端配置(Linux 未实现,直接返回 nil)
func WriteVncServerConfig(config VncServerConfig) error {
return nil
}
// EnableSoftwareSASGeneration 启用软件SAS模拟输入
func EnableSoftwareSASGeneration() error {
return nil
}
// EnableWinlogonDisableCAD 关闭 Ctrl + Alt + Del 组合键来登录
func EnableWinlogonDisableCAD() error {
return nil
}
// EnableSystemDisableCAD 关闭 Ctrl + Alt + Del 组合键来登录
func EnableSystemDisableCAD() error {
return nil
}