Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/govtechsg/slist
slist is a tool to list your servers in ssh config and ssh into it
https://github.com/govtechsg/slist
bash bash-script slist ssh ssh-client ssh-config ssh-connection tool zsh
Last synced: 5 days ago
JSON representation
slist is a tool to list your servers in ssh config and ssh into it
- Host: GitHub
- URL: https://github.com/govtechsg/slist
- Owner: GovTechSG
- License: mit
- Created: 2019-01-30T03:27:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-29T07:07:15.000Z (about 2 years ago)
- Last Synced: 2024-04-14T23:19:52.311Z (7 months ago)
- Topics: bash, bash-script, slist, ssh, ssh-client, ssh-config, ssh-connection, tool, zsh
- Language: Shell
- Homepage:
- Size: 420 KB
- Stars: 25
- Watchers: 8
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slist
![alt text](https://github.com/GovTechSG/slist/blob/master/slist.png?raw=true)
![version](https://img.shields.io/github/release/GovTechSG/slist.svg?style=flat) [![CI](https://github.com/GovTechSG/slist/actions/workflows/actions.yml/badge.svg)](https://github.com/GovTechSG/slist/actions/workflows/actions.yml)
slist is a tool to list your servers in ssh config and ssh into it.\
This only works on Unix machines.\
slist aims to solve the problem of users having to remember aliases or IP addresses of all their servers.\
slist reads the aliases in the ~/.ssh/config file and list them in the terminal.## Setting it up
```bash
$ cd
$ git clone https://github.com/GovTechSG/slist.git
$ chmod +x slist.sh# Use full path of slist.sh for symlink to work
$ ln -s /slist.sh /usr/local/bin/slist
$ slist
```## SSH Config File Format
```bash
# If you have a jump host
Host jumpHost
User
HostName
Port 22
IdentityFileHost
User
HostName
ProxyCommand ssh -A jumpHost nc %h %p # If you want to use the jumpHost to connect to the host
Port 22
IdentityFileHost
User
HostName
Port 22
IdentityFile
```## Usage
Usage: slist [-fhl]
[--add-host host_name --ip-adr ip_address [--ssh-user user --port port_number --keypath keyname_with_path]]
[--del-host host_name]```bash
-f Keyword to filter
-h Display help
-l List servers with ip addresses
-l -f Filter list work
-e Open and edit ~/.ssh/config
--add-host Add a new host to the SSH config file. Must be used together with --ip-adr option
--ip-adr Add a new IP address to the SSH config file. Must be used together with --add-host option
--ssh-user Add a new SSH user to SSH config file. Must be used together with --add-host and --ip-adr options
--port Add a new port number to SSH config file. Must be used together with --add-host and --ip-adr options
--keypath Add a new key file to SSH config file. Must be used together with --add-host and --ip-adr options
--del-host Delete a host from the SSH config file
--file To use other config file
--init To initialize a template SSH config file
```## Changing colours theme for slist
To make persistent color change to slist theme.\
If you are using bash shell, add below 2 lines to .bashrc or .profile or .bash_profile.\
If you are using zsh shell, add below 2 lines to .zshrc.\export color_theme1=cyan\
export color_theme2=yellowSupported colors:
black red green yellow blue pink cyan white## Screenshots
![Optional Text](../master/screenshots/slist.png)
![Optional Text](../master/screenshots/filter.png)## Developer Guide
### Running Tests
To run tests in tests/slist_test.sh you will need to install [shunit2](https://github.com/kward/shunit2)
```bash
# To install shunit2 on MacOS
$ brew install shunit2# To install shunit2 on Fedora/RHEL/CentOS/EPEL
$ yum install shunit2# To install shunit2 on Ubuntu
$ apt-get install shunit2# To run tests
$ ./tests/slist_test.sh
```### Contributing Your Code
If you would like to contribute to this repo, please open an issue, fork the repo, implement your code and tests and create a PR
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details