Code Monkey home page Code Monkey logo

autossh's Introduction

autossh

一个ssh远程客户端,可一键登录远程服务器,主要用来弥补Mac/Linux Terminal ssh无法保存密码的不足。

演示

版本说明

这是一个全新的autossh,无法兼容v0.2及以下版本,升级前请做好备份!新版配置文件由原来的servers.json改为config.json, 升级时可将旧配置文件的列表插入到新配置文件的servers节点下

注:旧版servers中method=pem需要更新为method=key

功能说明

  • 支持分组
  • 支持显示/隐藏主机详情(show_detail)
  • 支持options(目前仅支持ServerAliveInterval)
  • 允许配置文件中server默认值为空
  • 允许指定配置文件目径
  • 修复终端窗口大小改变时无法自适应的bug

下载

https://github.com/islenbo/autossh/releases

安装

  • 下载编译好的二进制包autossh,放在指目录下,如~/autossh/usr/loca/autossh
  • 同级目录下新建config.json文件,参考config.example.json
  • 将安装目录加入环境变量中,或指定别名alias autossh=your autossh path/autossh

config.json

{
  "show_detail": true, // 显示主机详情
  "options": { // 全局配置
    "ServerAliveInterval": 30 // 发送心跳包时间,同 ssh -o ServerAliveInterval=30
  },
  "servers": [
    {
      "name": "vagrant", // 显示名称
      "ip": "192.168.33.10", // 主机地址
      "port": 22, // 端口号,可省略,默认为22
      "user": "root", // 用户名
      "password": "vagrant", // 密码,使用无密码的key登录时可省略
      "method": "password", // 认证方式,可省略,默认值为password,可选项有password、key
      "key": "", // 密钥路径,method=key时有效,可省略,默认为~/.ssh/id_rsa
      "options": { // 自定义配置,会覆盖配置中相同的值
        "ServerAliveInterval": 20
      }
    },
    {
      "name": "vagrant-key",
      "ip": "192.168.33.10",
      "user": "root",
      "method": "key"
    }
  ],
  "groups": [
    {
      "group_name": "your group name",
      "prefix": "a",
      "servers": [
        {
          "name": "example1",
          "ip": "192.168.33.10",
          "user": "root",
          "password": "root"
        },
        {
          "name": "example2",
          "ip": "192.168.33.10",
          "user": "root",
          "password": "root"
        }
      ]
    },
    {
      "group_name": "group2",
      "prefix": "b",
      "servers": [
      ]
    }
  ]
}

Q&A

  • Q: Downloads中为什么没有Windows的包?
  • A: Windows下有很多ssh工具,autossh主要是面向Mac/Linux群体。

编译

go build main.go

依赖包

  • golang.org/x/crypto/ssh

autossh's People

Contributors

islenbo avatar jumping avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.