Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dmsg socks5 proxy #236

Merged
merged 11 commits into from
Feb 24, 2024
Merged

dmsg socks5 proxy #236

merged 11 commits into from
Feb 24, 2024

Conversation

0pcom
Copy link
Collaborator

@0pcom 0pcom commented Aug 7, 2023

This PR adds a simple socks5 proxy server and client which work over dmsg.

The motivation for this application is for it's eventual integration with the skywire-visor

If the server partof the application was run as part of the visor, it would enable ssh access over the proxy which should prove a major convenience.

Currently, remote visors can be accessed via ssh over skysocks ; however this requires that routes work.

Experience has shown us that routes cannot be expected to work without fail indefinitely ; thus in the instance that routes do not work, such a proxy application which would permit remote visors to be reached via ssh would prove invaluable if not critical for connecting to remote visors.

This does replicate some functionality provided by the dmsgpty ; however, if the socks5 server which works exclusively over dmsg which is included in this PR is run by default with the visor, no additional configuration is necessary in order to access the remote visor. Simply provide the user@localhost to ssh.

Currently it is necessary to set whitelisted keys for dmsgpty access.

Another advantage of using a proxy such as this for ssh access is that, compared to the dmsgpty, any user can be accessed via ssh. With dmsgpty it's only possible to connect, initially, to the account of the user which is running the dmsgpty-host

For reference, here is the current documentation with regards to ssh over the skywire socks5 proxy

https://github.com/skycoin/skywire/wiki/SSH-over-SOCKS5-Proxy

Testing

generate a keypair with skywire-cli config gen-keys

skywire-cli config gen-keys > keys.conf

Run the dmsg-socks5 proxy server

go run cmd/dmsg-socks5/dmsg-socks5.go server -s $(tail -n1 keys.conf)

Run the dmsg-socks5 proxy client

go run cmd/dmsg-socks5/dmsg-socks5.go client -s $(head -n1 keys.conf)

test the connection as detailed in the ssh over socks5 proxy guide or using curl

curl -x socks5h://localhost:1081 http://www.ip.skycoin.com/

@0pcom 0pcom merged commit 22e2bc0 into skycoin:develop Feb 24, 2024
3 checks passed
@0pcom 0pcom deleted the ssh-proxy branch February 24, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant