sshAutoLogin

sshAutoLogin

It can make your ssh login simply as well as efficiently on Mac or Linux.

we are frequently using ssh login remote server by terminal. We will find a headache that is often entering a repetitive command line. Fuck~ it’s a waste of time!Maybe you cloud write configure of alias on profile. enenen~ Finally, I determined to write a time-saving shell.Beginning with university stage.


它有什么特点或好处呢

  • 扩展性、配置化
  • 自动交互登录
  • 支持密码以及秘钥文件
  • 支持Mac以及Linux
  • 时间是生命呐

使用

查看帮助信息

➜  ~ ssha -h
usege:
ssha [-h] [-l] [-s <server alias>]

查看配置的服务器信息列表

➜  ~ ssha -l
Index   Description     Port    Host        Username    Password|SecretKeyFile
┌────────────────────────────────────────────────────────────────────────┐
│0       alicfengPC              127.0.0.1       22      alic    pwdalic │
└────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────┐
│1       us.samego.com           47.68.88.88     22      alic    u.know.pwd      │
└────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────┐
│2       hk.samego.com           120.88.88.86    22      alic    u.know.pwd      │
└────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│3       vpn.samego.com          68.120.80.86    22      alic    /home/alic/.ssha/key/vpn.samego.com.key │
└────────────────────────────────────────────────────────────────────────────────────────────────────────┘

快捷登录

➜  ~ ssha -s 0
┌────────────────────────────────────────┐
│alic logging into the alicfengPC  server│
└────────────────────────────────────────┘
spawn ssh -p 22 alic@127.0.0.1
alic@127.0.0.1's password: 
Welcome to elementary OS 0.4.1 Loki (GNU/Linux 4.13.0-32-generic x86_64)

Last login: Sat Aug 11 16:44:46 2018 from 127.0.0.1
➜  ~ 
successfully logined 【alicfengPC】
➜  ~ 

安装

Mac系统

➜  ~ curl -sSL https://raw.githubusercontent.com/alicfeng/sshAutoLogin/master/iMac.sh | bash

Debian系列

➜  ~ curl -sSL https://raw.githubusercontent.com/alicfeng/sshAutoLogin/master/iDebian.sh | bash

Redhats系列

➜  ~ curl -sSL https://raw.githubusercontent.com/alicfeng/sshAutoLogin/master/IRedHats.sh | bash

  • 配置说明

    每一个单元配置长什么样呢?

    Index=0
    Name=hostname
    Host=IP | domain
    Port=22
    User=alic
    PasswordOrKey=password

默认的配置目录路径

~/.ssha/

你看看我的示例目录Tree


➜  .ssha tree
.
├── 0_localhost.ini
├── 1_47.68.88.88.conf
├── 2_120.88.68.86.ini
└── 3_68.120.80.68.ini

0 directories, 4 files



___
[sshAutoLogin Github](https://github.com/alicfeng/sshAutoLogin) 
本作品采用《CC 协议》,转载必须注明作者和本文链接
价值源于技术,贡献源于分享 | 笔记分享归档 No matter where I am, I will reply you immediately when I see the email. My Email: echo "YUBzYW1lZ28uY29tCg==" | base64 -d 个人比较喜欢分享,若有不对的地方非常感谢指出 相互学习、共同进步~
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 3

为什么提示command not found

[root@VM_0_14_centos ~]# which bash
/usr/bin/bash
[root@VM_0_14_centos ~]# curl -sSL https://raw.githubusercontent.com/alicfeng/sshAutoLogin/master/Redhats.sh | bash
bash: line 1: 404:: command not found

更新,又出问题

wget  https://raw.githubusercontent.com/alicfeng/sshAutoLogin/master/iRedHats.sh  
sh iRedHats.sh
[root@VM_0_14_centos ~]# ssha -l

Index   Description             Port    Host            Username        Password|SecretKeyFile
/usr/local/bin/ssha: line 40: toilet: command not found
5年前 评论

@lovecn 多谢提醒,这里的command写错了,已经修改过来了

5年前 评论

@lovecn toilet这个可以自行编译构建

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!