Added ssh-agent from windows

This commit is contained in:
2025-09-23 09:16:20 +02:00
parent 86e7946a60
commit 236f8cd964
4 changed files with 34 additions and 1 deletions

View File

@@ -139,5 +139,7 @@ export PATH="$PATH:/opt/nvim-linux-x86_64/bin"
export PATH="$PATH:/home/wholteza/.local/bin"
export PATH=$PATH:/home/wholteza/.local/bin
source ~/.config/relay-ssh-agent.sh
eval "$(oh-my-posh init bash --config ~/.config/oh-my-posh/theme.omp.json)"
[[ -z "$TMUX" ]] && exec tmux

View File

@@ -5,6 +5,8 @@
local nvm_bin = os.getenv 'NVM_BIN'
local vue_typescript_plugin_path = nvm_bin .. '/../lib/node_modules/@vue/typescript-plugin'
vim.loader.enable()
-- "<leader>sh" to [s]earch the [h]elp documentation.
-- Set <space> as the leader key

11
.config/relay-ssh-agent.sh Executable file
View File

@@ -0,0 +1,11 @@
export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock
rm -f $SSH_AUTH_SOCK
(setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork &) >/dev/null 2>&1
# Check if the socket already exists
ss -a | grep -q $SSH_AUTH_SOCK
if [ $? -ne 0 ]; then
# Start a new socat process
rm -f $SSH_AUTH_SOCK
(setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork &) >/dev/null 2>&1
fi

View File

@@ -6,7 +6,12 @@ sudo apt install \
unzip \
ripgrep \
fzf \
fd-find
fd-find \
wget \
golang-go \
socat \
-y
curl -s https://ohmyposh.dev/install.sh | bash -s
@@ -17,3 +22,16 @@ sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
# Set up ssh-agent from windows
cd ~/.config
rm -rf npiperelay
git clone https://github.com/jstarks/npiperelay
go version
cd npiperelay
# Build the binary and store it in our Windows C: drive
go get -d github.com/jstarks/npiperelay
GOOS=windows go build -o /mnt/c/temp/npiperelay.exe github.com/jstarks/npiperelay
# Create a symlink to a directory in our PATH
sudo ln -s /mnt/c/temp/npiperelay.exe /usr/local/bin/npiperelay.exe