An open API service indexing awesome lists of open source software.

https://github.com/nulldev/ssh-starter

:rocket: This is a simple SSH Starter script
https://github.com/nulldev/ssh-starter

expec expectscript nulldev ssh tcl

Last synced: 10 months ago
JSON representation

:rocket: This is a simple SSH Starter script

Awesome Lists containing this project

README

          

# SSH-Starter-Interface

[![Build Status](https://travis-ci.org/NullDev/SSH-Starter.svg?branch=master)](https://travis-ci.org/NullDev/SSH-Starter)

This is a newer version of my SSH Starter script.

A small Expect script which will start SSH sessions with automatically entered password.

You can specify hostname, password, port and username inside the script for **4** different servers.

"ssh.sh" - When 97% of your keyboard is broken...

> Tested on Ubuntu 16.04 and 14.04

This script also features CLI arguments so you can connect to your server instantly without getting prompted to choose a server.

Usage:

$ `./ssh.sh 1`

$ `./ssh.sh 2`

$ `./ssh.sh 3`

$ `./ssh.sh 4`

**Extra feature**: You can pass a command as argument, which will be executed after login!

Example Usage:

$ `./ssh.sh 1 echo hello`


This will execute `echo hello` once the login was sucessful.

### Small code info:
`expect "assword:"` on Line 67 is not a typo.
It matches "Password" as well as "password".

## HOW TO INSTALL

1. Install expect script

   $ `sudo apt-get update`

   $ `sudo apt-get install expect`

2. Clone and navigate to this repository

   $ `git clone https://github.com/NullDev/SSH-Starter.git && cd SSH-Starter`

3. Move the script wherever you want

   $ `mv ssh.sh ..`

4. Edit the script as you need it

   $ `cd .. && nano ssh.sh`

5. Make the script executable

   $ `chmod +x ssh.sh`

6. Thats it! You can either start in from the terminal with

   $ `./ssh.sh`

Or by doubleclicking it!

## Optional:

If you do not want to store your password in the script directly, you could create a passwor file. Lets say you create a file called "p" in your home directory and store the password there. Then you can use

`set SERVER_1_PKEY [exec cat ~/p]`

instead of

`set SERVER_1_PKEY "password1"`

on Line 9 to 12.

However, this does not provide additional security (It isn't even security through obscurity). This is just for storing the password somewhere else instead of directly inside the script.




       Screenshot