Skip to content

probird5/go-ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go SSH

This is a terminal-based interactive tool built using Go, which allows users to select from a list of servers and establish an SSH connection either in a new alacritty terminal window or a new tmux tab.

Features

  • Text-based user interface (TUI) for easy SSH connection management.
  • Stores server details (name, address, description) in a TOML configuration file.
  • Opens SSH connections in a new terminal window (Alacritty).
  • Lightweight and easy to configure.

Prerequisites

  • Go 1.16 or later installed on your system.
  • tmux installed and configured.
  • alacritty installed and configured.

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/ssh-connection-tool.git
    cd ssh-connection-tool
  2. Build the tool:

    go build -o ssh-tool main.go
  3. Run the tool:

    ./ssh-tool

Usage

  1. Run the tool from your terminal:

    ./ssh-tool
  2. Use the arrow keys to navigate the list of servers.

  3. Press Enter to select a server.

  4. When prompted, choose:

    • a to open the SSH connection in a new alacritty terminal window.
    • t to open the SSH connection in a new tmux tab.
  5. The SSH session will start in the selected environment.

Configuration

**will be adding a config file so you do not need to modify the `` **

To add or remove servers from the list:

  1. Open the main.go file in your preferred text editor.
  2. Modify the items slice in the main function with your desired server names and descriptions.
  3. Update the getServerAddress function to include the SSH connection details for each server.
items := []list.Item{
    item{title: "Raspberry Pi’s", desc: "I have ’em all over my house"},
    item{title: "Linux Server", desc: "My main development server"},
    // Add more items as needed
}

func getServerAddress(serverName string) string {
    switch serverName {
    case "Raspberry Pi’s":
        return "pi@192.168.1.10"
    case "Linux Server":
        return "user@linux-server.com"
    // Add more cases for other items if needed
    default:
        return ""
    }
}

4 . Save your changes and rebuild the tool:

go build -o ssh-tool main.go

About

Tool to manage ssh session to my differrent servers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages