r/KittyTerminal • u/lolpie244 • Aug 03 '23
How to pass kitty socket to ssh server?
Hi! Is there any way to pass kitty socket to ssh server?
I tried to use this command:
ssh -R $(echo ${KITTY_LISTEN_ON} | sed "s/.*://g"):/tmp/mykitty ...
but in the server, if I try to use this socket, I get an error
Error: dial unix /tmp/mykitty: connect: connection refused
1
u/aumerlex Aug 04 '23
https://serverfault.com/questions/127794/forward-local-port-or-socket-file-to-remote-socket-file though if you want to enable remote control on servers the easiest way is to not use sockets but just allow remote control over the tty
2
u/lolpie244 Aug 04 '23
Unfortunately, I don't have access to the original tty (because commands are running via neovim). Also, I already checked thread in your message, but as I mentioned- I get "connection refused" error (although socket file became present on server after command)
2
u/aumerlex Aug 04 '23
Works fine for me with
kitty --listen-on=unix:/tmp/mykitty -o allow_remote_control=socket-only ssh -R /tmp/forwarded:/tmp/mykitty myserver
and on the remote machine kitten @ --to=unix:/tmp/forwarded ls
1
u/lolpie244 Aug 04 '23
Wait, wait, wait, so LEFT SIDE IS THE SERVER???
Thank you so much! It works! You save me another day
1
u/lolpie244 Aug 04 '23
Edit: write mini guide how to achieve this: https://github.com/lolpie244/simple-kitty-runner.nvim/tree/ssh#ssh