All Projects → whorusq → ssh-autologin

whorusq / ssh-autologin

Licence: other
一个基于 ssh 快捷登录远程服务器的脚本

Programming Languages

shell
77523 projects
elixir
2628 projects

Projects that are alternatives of or similar to ssh-autologin

Sidedoor
SSH connection daemon for Debian/Raspbian/Ubuntu/etc
Stars: ✭ 97 (+470.59%)
Mutual labels:  ssh-client
Sshj
ssh, scp and sftp for java
Stars: ✭ 2,016 (+11758.82%)
Mutual labels:  ssh-client
Hss
An interactive parallel ssh client featuring autocomplete and asynchronous execution.
Stars: ✭ 248 (+1358.82%)
Mutual labels:  ssh-client
Ssh
Native SSH client in R based on libssh
Stars: ✭ 111 (+552.94%)
Mutual labels:  ssh-client
Wolfssh
wolfSSH is a small, fast, portable SSH implementation, including support for SCP and SFTP.
Stars: ✭ 142 (+735.29%)
Mutual labels:  ssh-client
Github Keygen
Easy creation of secure SSH configuration for your GitHub account(s)
Stars: ✭ 183 (+976.47%)
Mutual labels:  ssh-client
Daggy
Daggy - Data Aggregation Utility. Open source, free, cross-platform, server-less, useful utility for remote or local data aggregation and streaming
Stars: ✭ 91 (+435.29%)
Mutual labels:  ssh-client
sigil
AWS SSM Session manager client
Stars: ✭ 67 (+294.12%)
Mutual labels:  ssh-client
Sshfs Gui
SSHFS GUI Wrapper for Mac OS X
Stars: ✭ 154 (+805.88%)
Mutual labels:  ssh-client
Bastillion
Bastillion is a web-based SSH console that centrally manages administrative access to systems. Web-based administration is combined with management and distribution of user's public SSH keys.
Stars: ✭ 2,730 (+15958.82%)
Mutual labels:  ssh-client
Superputty
The SuperPuTTY Window Manager for putty sessions
Stars: ✭ 1,572 (+9147.06%)
Mutual labels:  ssh-client
Connectbot
ConnectBot is the first SSH client for Android.
Stars: ✭ 1,763 (+10270.59%)
Mutual labels:  ssh-client
Easyssh
The SSH connection manager to make your life easier.
Stars: ✭ 207 (+1117.65%)
Mutual labels:  ssh-client
Lssh
List selection type alternative ssh/scp/sftp client. Pure Go.
Stars: ✭ 110 (+547.06%)
Mutual labels:  ssh-client
termscp
🖥 A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3
Stars: ✭ 707 (+4058.82%)
Mutual labels:  ssh-client
Iap Desktop
IAP Desktop is a Windows application that provides zero-trust Remote Desktop and SSH access to Linux and Windows VMs on Google Cloud.
Stars: ✭ 96 (+464.71%)
Mutual labels:  ssh-client
Ssh2 Python
Bindings for libssh2 C library.
Stars: ✭ 166 (+876.47%)
Mutual labels:  ssh-client
promisify-child-process
seriously like the best async child process library
Stars: ✭ 54 (+217.65%)
Mutual labels:  spawn
tallow
Block hosts that attempt to bruteforce SSH using the journald API.
Stars: ✭ 79 (+364.71%)
Mutual labels:  ssh-client
Jcabi Ssh
Java SSH client
Stars: ✭ 240 (+1311.76%)
Mutual labels:  ssh-client

SSH 自动登录脚本

1. 执行效果演示

./screenshot.gif

2. 如何使用当前脚本

  1. git clone https://github.com/whorusq/shell-ssh-autologin.git
  2. cd shell-ssh-autologin
  3. 修改 goto.conf ,追加服务器列表
  4. 赋予脚本可执行权限 sudo chmod u+x goto.sh goto.ex
  5. 使用
    • 方式一:./goto.sh

    • 方式二:将 goto 加入当前用户全局使用

      ~ echo "alias goto=\"$PWD/goto.sh\"" >> ~/.zshrc
       ➜  ~ source ~/.zshrc
       ➜  ~ goto

3. 常见问题

3.1. 提示没有 expect 或 spawn 命令

当前脚本主要基于 expect 使用 spawn 实现。

Expect 是一个用来处理交互的工具,通常用于需要手动输入数据的场景,可在脚本中使用 Expect 来实现自动化。

首先使用以下命令检查 expect 是否已安装:

➜  whereis expect
/usr/bin/expect

如果没有安装,请按照以下步骤:

  1. 安装 expect 的依赖 tcl

    ➜  wget https://sourceforge.net/projects/tcl/files/Tcl/8.4.19/tcl8.4.19-src.tar.gz
    ➜  tar zxvf tcl8.4.19-src.tar.gz
    ➜  cd tcl8.4.19/unix && ./configure
    ➜  make
    ➜  make install
    
  2. 安装 expect

    ➜  wget http://sourceforge.net/projects/expect/files/Expect/5.45/expect5.45.tar.gz
    ➜  tar zxvf expect5.45.tar.gz
    ➜  cd expect5.45
    ➜  ./configure --with-tcl=/usr/local/lib --with-tclinclude=../tcl8.4.19/generic
    ➜  make
    ➜  make install
    ➜  ln -s /usr/local/bin/expect /usr/bin/expect
    

3.2. 特殊字符转义

如果密码中有特殊字符,需要做转义处理,否则使用 expect 的 send 语法是无法发送成功的,具体需要转义的字符如下:

\ ===> \\\
} ===> \}
[ ===> \[
$ ===> \\\$
` ===> \`
" ===> \\\"
~ ===> \\~
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].