remoteshell

package module
v0.0.0-...-238f09c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2017 License: MIT Imports: 5 Imported by: 0

README

Remote shell GoDoc Build Status

A client-server remote shell implemented in Go using gRPC and Protocol Buffers. Created by Taylor Flatt and Arjun Yelamanchili

Usage

  • Get the source code by running go get github.com/taylorflatt/remote-shell
  • First, run the server by going to the Server directory and typing go run server.go.
  • Next, run the client by going to the Client directory and typing go run client.go.
  • In the client, enter in the server IP to establish a connection over gRPC.
  • Input any shell command to be run on the server.

Notes

To disconnect from the server, press ctrl+c or type exit (hit enter) and the client will disconnect from the server.

This client/server assumes a 12021 port.

Documentation

Overview

Package remoteshell is a generated protocol buffer package.

Maybe this needs to be changed if we run into problems.

It is generated from these files:

services.proto

It has these top-level messages:

CommandRequest
CommandReply

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRemoteCommandServer

func RegisterRemoteCommandServer(s *grpc.Server, srv RemoteCommandServer)

Types

type CommandReply

type CommandReply struct {
	Output string `protobuf:"bytes,1,opt,name=output" json:"output,omitempty"`
}

Response message

func (*CommandReply) Descriptor

func (*CommandReply) Descriptor() ([]byte, []int)

func (*CommandReply) GetOutput

func (m *CommandReply) GetOutput() string

func (*CommandReply) ProtoMessage

func (*CommandReply) ProtoMessage()

func (*CommandReply) Reset

func (m *CommandReply) Reset()

func (*CommandReply) String

func (m *CommandReply) String() string

type CommandRequest

type CommandRequest struct {
	CmdName string   `protobuf:"bytes,1,opt,name=cmdName" json:"cmdName,omitempty"`
	CmdArgs []string `protobuf:"bytes,2,rep,name=cmdArgs" json:"cmdArgs,omitempty"`
}

Request message

func (*CommandRequest) Descriptor

func (*CommandRequest) Descriptor() ([]byte, []int)

func (*CommandRequest) GetCmdArgs

func (m *CommandRequest) GetCmdArgs() []string

func (*CommandRequest) GetCmdName

func (m *CommandRequest) GetCmdName() string

func (*CommandRequest) ProtoMessage

func (*CommandRequest) ProtoMessage()

func (*CommandRequest) Reset

func (m *CommandRequest) Reset()

func (*CommandRequest) String

func (m *CommandRequest) String() string

type RemoteCommandClient

type RemoteCommandClient interface {
	// Sends a remote command from a client to a server.
	SendCommand(ctx context.Context, in *CommandRequest, opts ...grpc.CallOption) (*CommandReply, error)
}

func NewRemoteCommandClient

func NewRemoteCommandClient(cc *grpc.ClientConn) RemoteCommandClient

type RemoteCommandServer

type RemoteCommandServer interface {
	// Sends a remote command from a client to a server.
	SendCommand(context.Context, *CommandRequest) (*CommandReply, error)
}

Directories

Path Synopsis
Package client which will connect to a server and run a Go command.
Package client which will connect to a server and run a Go command.
Package server will execute all commands issued by connected clients.
Package server will execute all commands issued by connected clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL