Skip to content

armstrong1972/ArmSSHClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArmSSHClient


SSHClient by Golang
xShell收费,FinalShell太慢,自己用Go语言开发一个简单易用的 SSH Client 套餐包,包括:


1) shkey.exe : 生成一对RAS2048的密钥对字符串 (如不重新编译代码,可跳过此步)

  • 公钥: 复制到 shpwd.go 代码文件中,用于为 SSH 密码加密
  • 私钥: 复制到 sh.go 代码文件中,用于解密 配置文件 中的密码

  • 2) shpwd.exe : 用公钥加密你的SSH站点的密码 ,将结果复制到配置文件的 “cipher” 参数中
        用法: > shpwd.exe yourpassword


    3) 增加 SSH配置文件(.json), 配置文件放在 ./config 目录下
    配置文件格式如下 :
    {
        "mod" : "pem",
        "addr" : "15.15.15.15:22",
        "user" : "ec2-user",
        "cipher" : "aws.pem"
    }
    其中:

  • mod : 有2个值可选。"pem" : 公钥模式 或 “pwd” : 密码模式
  • cipher :
            公钥模式 : pem文件名, 放在 ./config/pem 目录下
            密码模式 : 存放 shpwd.exe 程序加密后的 字符串

  • 4) sh.exe> : SSH主程序,带一个参数
        用法: > sh.exe config_file (不带扩展名)
        案例: > sh.exe artcube
            自动加载 config 目录下的 artcube.json 配置文件,并连接SSH