Code Monkey home page Code Monkey logo

ce-ssh's Introduction

ce-ssh

Two parts:

  • udp-client -> udp->tcp proxy -> ssh client/tunnel -> sshd (on a VM)
  • sshd (VM) -> tcp->udp proxy -> udp_service

The server (sshd) side of things is run in a set of Code Engine jobs. One for sshd (to simulate a VM), and one for the UDP listening service. The VM will have 2 processes running:

  • sshd
  • netcat

Netcat will proxy tcp connections to udp, which then gets forwarded on to the udp_service.

The sshd process will just wait for incoming ssh connections.

The ssh client/tunnel will do two things:

  • create an ssh connection to the fake VM
  • create a udp->tdp proxy so our udp-client can send udp messages to the udp->tcp proxy, which then forwards on to the ssh (tcp) tunnel

The entire ssh key sharing thing you'll see in the vm setup is just for demo purposes. Do not do share ssh keys this way in a real env.

Do it!

Create a Code Engine project and make sure it's selected:

$ ibmcloud ce project create -n demo

Then create the fake VM:

$ cd vm
$ ./run

Now run the client app that will send UDP messages:

$ cd ../app
$ ./run

If everything worked then you should see the output of the client app like this:

2021/09/28 00:38:21 Connecting to: 172.30.165.203:1234
Reply: yes I got:From client message #0
Reply: yes I got:From client message #1
Reply: yes I got:From client message #2
Reply: yes I got:From client message #3
Reply: yes I got:From client message #4
Reply: yes I got:From client message #5
Reply: yes I got:From client message #6
Reply: yes I got:From client message #7
Reply: yes I got:From client message #8
Reply: yes I got:From client message #9
Job run completed successfully.

Clean up

$ vm/run clean
$ app/run clean

ce-ssh's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.