Skip to content

dmsgpty cli

Moses Narrow edited this page Jul 7, 2023 · 1 revision

DMSG PseudoTerminal (PTy) Cli

The dmsgpty-cli is effectively a substitute for ssh. It is used to remotely access a dmsgpty-host

The authentication mechanism is whitelist-based.

dmsgpty-host

[user@linux ~]$ dmsgpty-host --help

	┌┬┐┌┬┐┌─┐┌─┐┌─┐┌┬┐┬ ┬   ┬ ┬┌─┐┌─┐┌┬┐
	 │││││└─┐│ ┬├─┘ │ └┬┘───├─┤│ │└─┐ │
	─┴┘┴ ┴└─┘└─┘┴   ┴  ┴    ┴ ┴└─┘└─┘ ┴

Usage:
  dmsgpty-host 

Available Commands:
  completion   Generate the autocompletion script for the specified shell
  confgen      generates config file

Flags:
      --cliaddr string      address used for listening for cli connections (default "/tmp/dmsgpty.sock")
      --clinet string       network used for listening for cli connections (default "unix")
  -c, --confpath string     config path (default "./config.json")
      --confstdin           config will be read from stdin if set
      --dmsgdisc string     dmsg discovery address (default "http://dmsgd.skywire.skycoin.com")
      --dmsgport uint16     dmsg port for listening for remote hosts (default 22)
      --dmsgsessions int    minimum number of dmsg sessions to ensure (default 1)
      --envprefix string    env prefix (default "DMSGPTY")
      --wl cipher.PubKeys   whitelist of the dmsgpty-host (default public keys:
                            )


image

dmsgpty-cli

$ dmsgpty-cli --help

	┌┬┐┌┬┐┌─┐┌─┐┌─┐┌┬┐┬ ┬   ┌─┐┬  ┬
	 │││││└─┐│ ┬├─┘ │ └┬┘───│  │  │
	─┴┘┴ ┴└─┘└─┘┴   ┴  ┴    └─┘┴─┘┴

Usage:
  dmsgpty-cli 

Available Commands:
  completion        Generate the autocompletion script for the specified shell
  whitelist         lists all whitelisted public keys
  whitelist-add     adds public key(s) to the whitelist
  whitelist-remove  removes public key(s) from the whitelist

Flags:
      --addr dmsg.Addr    remote dmsg address of format 'pk:port'
                           If unspecified, the pty will start locally
                           (default 000000000000000000000000000000000000000000000000000000000000000000:~)
  -a, --args strings      command arguments
      --cliaddr string    address to use for dialing to dmsgpty-host (default "/tmp/dmsgpty.sock")
      --clinet string     network to use for dialing to dmsgpty-host (default "unix")
  -c, --cmd string        name of command to run
                           (default "/bin/bash")
      --confpath string   config path (default "config.json")


image

The skywire-visor provides a dmsgpty-host by default, which uses the visor's public key.

Access remote visors with skywire-cli dmsgpty

The skywire-cli provides the dmsgpty-cli functionality

$ skywire-cli dmsgpty --help
Interact with remote visors

Usage:
  cli dmsgpty 

Available Commands:
  ui           Open dmsgpty UI in default browser
  url          Show dmsgpty UI URL
  list         List connected visors
  start        Start dmsgpty session

image

In order to access a remote visor from a locally running visor using skywire-cli via dmsgpty, the local visor's public key must be set as a remote hypervisor for the visor to be accessed.

Alternatively, a keypair may be generated with skywire-cli config gen-keys and the public key can be whitelisted on the remote visor.

Then, the secret key of the whitelisted public key may be specified to dmsgpty-cli and the dmsg pseudoterminal may be accessed using the public key of the remote visor

Clone this wiki locally