Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
masahide committed Oct 5, 2024
1 parent 46969ef commit 7da824a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 36 deletions.
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OmniSSHAgent is a program to simplify what used to be a chaotic situation, as sh

## The following interfaces are supported
- pageant.exe(PuTTY) shared memory
- Unix domain socket for WSL2
- Unix domain socket for WSL3
- NamedPipe on Windows
- Unix domain socket for WSL1
- Unix domain socket for MSYS2(Cygwin) ( [#1](https://github.com/masahide/OmniSSHAgent/issues/1) )
Expand Down Expand Up @@ -53,41 +53,29 @@ OmniSSHAgent does not have an installer, nor registers itself to start upon boot


### Using with WSL2
#### Setting up socat pipe in Ubuntu(WSL2).
#### Setting up wsl2-ssh-agent-proxy in Ubuntu or Rocky(WSL2).
Choose the instructions for your favourite shell below. If your shell isn't listed here you can convert the bash script to your shell syntax and send a PR to add it to the repo.

##### Bash (and all POSIX-compliant shells)
1. Download [ubuntu.setup.sh](hack/ubuntu.setup.sh) with the following command:
```bash
mkdir -p $HOME/omni-socat
curl -sL https://raw.githubusercontent.com/masahide/OmniSSHAgent/main/hack/ubuntu.setup.sh -o $HOME/omni-socat/ubuntu.setup.sh
mkdir -p $HOME/wsl2-ssh-agent-proxy
curl -sL https://raw.githubusercontent.com/masahide/OmniSSHAgent/wsl2-ssh-agent-proxy/hack/ubuntu.wsl2-ssh-agent-proxy.sh -o $HOME/wsl2-ssh-agent-proxy/ubuntu.wsl2-ssh-agent-proxy.sh
```
2. Add the following line to `~/.bashrc`, `~/.zshrc`, or whatever file is applicable to your shell:
```bash
source $HOME/omni-socat/ubuntu.setup.sh
source $HOME/wsl2-ssh-agent-proxy/ubuntu.wsl2-ssh-agent-proxy.sh
```

##### Fish
1. Download [ubuntu-fish.setup.fish](hack/ubuntu-fish.setup.fish) with the following command:
```fish
mkdir -p $HOME/omni-socat
curl -sL https://raw.githubusercontent.com/masahide/OmniSSHAgent/main/hack/ubuntu-fish.setup.fish -o $HOME/omni-socat/ubuntu-fish.setup.fish
mkdir -p $HOME/wsl2-ssh-agent-proxy
curl -sL https://raw.githubusercontent.com/masahide/OmniSSHAgent/wsl2-ssh-agent-proxy/hack/ubuntu.wsl2-ssh-agent-proxy-fish.sh -o $HOME/wsl2-ssh-agent-proxy/ubuntu.wsl2-ssh-agent-proxy-fish.sh
```
2. Add the following line to `~/.config/fish/config.fish`:
```fish
. $HOME/omni-socat/ubuntu-fish.setup.fish
```

#### Setting up socat pipe in rocky linux.

1. Download [rocky.setup.sh](hack/rocky.setup.sh) with the following command
```bash
mkdir -p $HOME/omni-socat
curl -sL https://raw.githubusercontent.com/masahide/OmniSSHAgent/main/hack/rocky.setup.sh -o $HOME/omni-socat/rocky.setup.sh
```
2. Add the following line to `~/.bashrc`, `~/.zshrc`, or whatever file is applicable to your shell:
```bash
source $HOME/omni-socat/rocky.setup.sh
. $HOME/wsl2-ssh-agent-proxy/ubuntu.wsl2-ssh-agent-proxy-fish.sh
```

### Using with WSL1
Expand Down Expand Up @@ -120,12 +108,12 @@ Variable name: SSH_AUTH_SOCK
Variable Value: /mnt/c/Users/<UserName>/OmniSSHAgent.sock
```

## Using with 1Password proxy mode
## Using with OpenSSH ssh-agent NamedPipe (1Password etc.) proxy mode

This is a mode using [1Password's ssh-agent function](https://developer.1password.com/docs/ssh/) as a backend as shown in the following figure.
![1Password-Proxy-mode](https://github.com/masahide/OmniSSHAgent/blob/main/doc/1passwordProxyMode.png?raw=true)
This is a mode using [OpenSSH ssh-agent NamedPipe](https://learn.microsoft.com/windows-server/administration/openssh/openssh_keymanagement) or [1Password's ssh-agent function](https://developer.1password.com/docs/ssh/agent/) as a backend as shown in the following figure.
![NamedPipe-Proxy-mode](https://github.com/masahide/OmniSSHAgent/blob/main/doc/NamedPipeProxyMode.png?raw=true)

By setting "Enable proxy mode for 1Password key-agent" in the configuration, OmniSSHAgent becomes a Proxy that works with 1Password's ssh-agent as a backend.
By setting "Enable proxy mode for 1Password key-agent" in the configuration, OmniSSHAgent becomes a Proxy that works with 1Password or OpenSSH's Namedpipe ssh-agent as a backend.

When "Enable proxy mode for 1Password key-agent" is enabled, OmniSSHAgent operates as a mere proxy, and therefore, private keys cannot be added.

Expand Down
Binary file removed doc/1passwordProxyMode.png
Binary file not shown.
Binary file added doc/NamedPipeProxyMode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 15 additions & 9 deletions doc/1passwordProxyMode.po → doc/NamedPipeProxyMode.po
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OmniSSHAgent - 1Password proxy mode
# OmniSSHAgent - Named pipe proxy mode


@startuml
Expand All @@ -12,30 +12,36 @@ skinparam nodeFontSize 20

left to right direction

node "1Password\n(ssh-agent)" as 1password #skyblue
node "OpenSSH ssh-agent\nor\n1Password etc.\n(named pipe)" as namedpipe #skyblue

rectangle "OmniSSHAgent" {
node "OmniSSHAgent\n(proxy mode)" as omniagent #pink;line:red;line.bold;text:black;
agent "omni-socat" as proxy #pink;line:red;text:black;
agent "Powershell\nScript" as ps #pink;line:red;text:black;
}

rectangle Client {
agent "<Windows>\nOpenSSH\nssh.exe" as msssh #skyblue
agent "WinSCP\nFileZilla\nPuTTY" as putty #skyblue
agent "<WSL1>\nssh" as wsl1ssh #gray
agent "<WSL2>\n(used socat pipe)\nssh" as wsl2ssh #limegreen
rectangle "<WSL2>" #limegreen {
agent "wsl2-ssh-agent-proxy" as wsl2proxy #pink;line:red
agent ssh as wsl2ssh #limegreen
}
agent "<cygwin\n(MSYS2)>\nssh.exe" as cygwinssh #darkgoldenrod
}

1password --> omniagent #line:blue;line.bold;text:blue : "NamedPipe"

1password --> msssh #line:blue;line.bold;text:blue : "NamedPipe"
namedpipe --> omniagent #line:blue;line.bold;text:blue : "NamedPipe"

namedpipe --> msssh #line:blue;line.bold;text:blue : "NamedPipe"
omniagent --> putty #line:crimson;line.bold;text:crimson : "pageant_shm"
omniagent --> wsl1ssh #line:black;line.bold;text:black : "WSL1UnixSocket"
1password -d-> proxy #line:blue;line.bold;text:blue : "NamedPipe"
namedpipe -d-> ps #line:blue;line.bold;text:blue : "NamedPipe"

ps --> wsl2proxy : "stdout/stdin"

proxy --> wsl2ssh : "stdout/stdin"
wsl2proxy --> wsl2ssh

omniagent --> cygwinssh #line:sienna;line.bold;text:sienna : "cygwinUnixSocket"

@enduml
@enduml
Binary file modified doc/OmniSSHAgent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions doc/omni-ssh-agent.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ rectangle ssh-add {

rectangle OmniSSHAgent {
node "OmniSSHAgent" as omniagent #pink;line:red;line.bold;text:black;
agent "omni-socat" as proxy #pink;line:red;text:black;
agent "Powershell\nScript" as proxy #pink;line:red;text:black;
}

rectangle Client {
agent "<Windows>\nOpenSSH\nssh.exe" as msssh #skyblue
agent "WinSCP\nFileZilla\nPuTTY" as putty #skyblue
agent "<WSL1>\nssh" as wsl1ssh #gray
agent "<WSL2>\n(used socat pipe)\nssh" as wsl2ssh #limegreen
rectangle "<WSL2>" #limegreen {
agent "wsl2-ssh-agent-proxy" as wsl2proxy #pink;line:red
agent ssh as wsl2ssh #limegreen
}
agent "<cygwin\n(MSYS2)>\nssh.exe" as cygwinssh #darkgoldenrod
}

Expand All @@ -42,7 +45,9 @@ omniagent --> putty #line:crimson;line.bold;text:crimson : "pageant_shm"
omniagent --> wsl1ssh #line:black;line.bold;text:black : "WSL1UnixSocket"
omniagent -d-> proxy #line:blue;line.bold;text:blue : "NamedPipe"

proxy --> wsl2ssh : "stdout/stdin"
proxy --> wsl2proxy : "stdout/stdin"

wsl2proxy --> wsl2ssh

omniagent --> cygwinssh #line:sienna;line.bold;text:sienna : "cygwinUnixSocket"

Expand Down

0 comments on commit 7da824a

Please sign in to comment.