Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hyper-w/interactive-ssh
Interactive connection using ssh config file.
https://github.com/hyper-w/interactive-ssh
bash bash-script bat batch-script powershell powershell-script shell-script ssh ssh-config ssh-connection windows-terminal windows-terminal-configure
Last synced: 20 days ago
JSON representation
Interactive connection using ssh config file.
- Host: GitHub
- URL: https://github.com/hyper-w/interactive-ssh
- Owner: Hyper-W
- License: mit
- Created: 2022-03-18T15:55:56.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-24T13:31:45.000Z (over 2 years ago)
- Last Synced: 2024-11-22T11:17:14.420Z (3 months ago)
- Topics: bash, bash-script, bat, batch-script, powershell, powershell-script, shell-script, ssh, ssh-config, ssh-connection, windows-terminal, windows-terminal-configure
- Language: PowerShell
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# interactive-ssh
A set of Bash and PowerShell scripts that allow interactive connections to hosts configured in ssh config.
Created to reduce profiles for ssh in Windows Terminal.
## How To Use
### Bash
Requirements
- ssh
- git
- grep(GNU grep)
- cut(GNU coreutils)
- nl(GNU coreutils)```bash
git clone https://github.com/Hyper-W/interactive-ssh.gitcd interactive-ssh
chmod a+xr ./Bash/interactive-ssh.sh
sudo cp ./Bash/interactive-ssh.sh /usr/local/bin/interactive-ssh
interactive-ssh
```### PowerShell/Pwsh
Requirements
- ssh
- git
- powershell or pwsh```PowerShell
git clone https://github.com/Hyper-W/interactive-ssh.gitcd interactive-ssh
```#### GUI
```PowerShell
explorer.exe .\PowerShell
```If you want to use it with `powershell.exe`, double click on `interactive-ssh.bat`.
If you want to use it with `pwsh.exe`, double click on `interactive-ssh-pwsh.bat`.
#### CLI
```PowerShell
powershell.exe -ExecutionPolicy Unrestricted -File ".\interactive-ssh.ps1" # PowerShellpwsh.exe -File ".\interactive-ssh.ps1" # Pwsh
pwsh -File "./interactive-ssh.ps1" # Pwsh on Linux
```### Windows Terminal Profile
Add the following entry to the `list` of `profiles` in `settings.json`.
Please change `${YOUR_GUID}`, `${CLONE_PATH}` and `${YOUR_SSH_DISTRIBUTION}` to your own values.
Running the added profile will execute `interactive-ssh`.
#### WSL
```json
{
"commandline": "wsl.exe -d ${YOUR_SSH_DISTRIBUTION} interactive-ssh",
"guid": "{${YOUR_GUID}}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
"name": "WSL SSH"
}
```#### PowerShell
```json
{
"commandline": "powershell.exe -ExecutionPolicy Unrestricted -File ${CLONE_PATH}\\PowerShell\\interactive-ssh.ps1",
"guid": "{${YOUR_GUID}}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
"name": "SSH"
}
```#### Pwsh
```json
{
"commandline": "pwsh.exe -File ${CLONE_PATH}\\PowerShell\\interactive-ssh.ps1",
"guid": "{${YOUR_GUID}}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
"name": "SSH"
}
```### After executing the `interactive-ssh`
You will be prompted to select a hosts.
Enter the number of the host you want to connect to via ssh from among the hosts displayed.
After selection, you will be connected to the selected host via ssh.