GithubHelp home page GithubHelp logo

assh's Introduction

assh

自动登录ssh脚本,使用 expect ,优化操作和加入配置文件

只限制 linux 机器使用

linux 系统在开发中连接 ssh 很不方便,没有像 windows 有趁手的客户端,但系统自带的终端很得我心,所以写了这个脚本可以继承原生终端的优点,又可以自动连接服务器

第一步,需先安装 expect

sudo apt install -y expect

centos/redhat 系列需先安装

sudo yum instal -y expect

其他发行版自行使用包管理安装 expect

第二步,配置服务器连接信息

配置文件位于项目目录/ssh_hosts.conf,里面有注释说明以及配置格式

第三步,运行脚本选择服务器进行连接

cd 此项目目录
./assh.sh
# 输入序号进行连接(直接回车默认0)
# 如无执行权限,请先  chmod +x run.sh expect.sh

第四部,配置alias,简化操作

vi ~/.bashrc
# 最后一行加入
alias assh='/此项目绝对路径/assh.sh'
alias assh_conf='vi /此项目绝对路径/ssh_config.conf'
# 示例
# alias assh='/var/www/assh/assh.sh'

# 即时生效
source ~/.bashrc

Features

  • 优化超时,每60秒发送ping包,避免终端假死
  • 兼容密码和私钥登录,自行配置
  • 使用原生ssh命令,非编程语言接口封装,所以你用的终端是什么样,连接后的操作也是什么样。(比如继承ctrl+c/v)

assh's People

Contributors

yybawang avatar

Watchers

 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.