Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/josbroers/ssh-connect

Easily connect to and manage your SSH connections.
https://github.com/josbroers/ssh-connect

linux scp server-tools ssh

Last synced: about 2 months ago
JSON representation

Easily connect to and manage your SSH connections.

Awesome Lists containing this project

README

        

# SSH Connect

![npm](https://img.shields.io/npm/v/@josbroers/ssh-connect)

A package to easily connect and manage your SSH connections.

Note: the arguments are optional

## Table of contents

- [1. Node.js](#1-nodejs)
- [2. Configure](#2-configure)
- [3. Scripts](#3-scripts)
- [3.2 Aliases](#32-aliases)

## 1. Node.js

First install the Node.js higher or equal to 16. Use the JavaScript Tool Manager [Volta](https://volta.sh/) or
the [Node Version Manager](https://github.com/nvm-sh/nvm).

## 2. Configure

Before you can use this package as an executable you need to create a JSON file. Run the following command to create
this file:

```bash
ssh-connect configure
```

## 3. Scripts

#### To create a connections file, use:

```bash
ssh-connect configure
```

#### To list all the defined connections, use:

```bash
ssh-connect list
```

#### To connect to a listed connection, use:

```bash
ssh-connect connect
```

#### To add a new connection, use:

```bash
ssh-connect add
```

#### To remove a listed connection, use:

```bash
ssh-connect remove
```

#### To edit a listed connection, use:

```bash
ssh-connect edit
```

#### To get the IP-address of a listed connection, use:

```bash
ssh-connect get
```

#### To list all the available aliases, use:

```bash
ssh-connect aliases
```

### 3.2 Aliases

You can use aliases to predefine the type, connection:

```bash
alias ssh-con="ssh-connect connect $HOME/connections.json"
alias ssh-add="ssh-connect add $HOME/connections.json"
alias ssh-rm="ssh-connect remove $HOME/connections.json"
alias ssh-ls="ssh-connect list $HOME/connections.json"
alias ssh-edit="ssh-connect edit $HOME/connections.json"
alias ssh-get="ssh-connect get $HOME/connections.json"
alias ssh-alias="ssh-connect aliases $HOME/connections.json"
```

You can take it even further by making aliases for specific connection names:

```bash
alias google="ssh-connect connect $HOME/connections.json google"
alias ssh-google="ssh-connect connect $HOME/connections.json google"

alias cloudflare="ssh-connect connect $HOME/connections.json cloudflare"
alias ssh-cloudflare="ssh-connect connect $HOME/connections.json cloudflare"
```