2
0
mirror of https://github.com/miguelmota/cointop synced 2024-11-16 21:25:38 +00:00
cointop/docs/content/ssh.md
2021-04-06 01:11:34 -07:00

1.6 KiB

title date draft
SSH 2020-01-01T00:00:00-00:00 false

SSH Server

The SSH server requires that the host has SSH keys, so generate SSH keys if not already:

$ ssh-keygen

Check keys were generated:

$ ls ~/.ssh
id_rsa id_rsa.pub

Run SSH server:

cointop server -p 2222

If the host SSH keys live elsewhere, specify the location:

cointop server -p 2222 -k ~/.ssh/some-dir/id_rsa

SSH into server to see cointop:

ssh localhost -p 2222

The cointop SSH server will use the client's public SSH key as the identifier for persistent config by default. You may change it to use the username instead:

cointop server -p 2222 --user-config-type=username

SSH'ing into server with same username will use the same respective config now:

ssh alice@localhost -p 2222

Pass arguments to cointop on SSH server by using SSH -t flag followed by cointop command and arguments. For example:

ssh localhost -p 2222 -t cointop --colorscheme synthwave

Using docker to run SSH server:

docker run -p 2222:22 -v ~/.ssh:/keys --entrypoint cointop -it cointop/cointop server -k /keys/id_rsa

cointop server writes the client config to /tmp/cointop_config within the container, so to make it persistent in host attach a volume. The following example will to write the cached config to ~/.cache/cointop on the host:

docker run -p 2222:22 -v ~/.ssh:/keys -v ~/.cache/cointop:/tmp/cointop_config --entrypoint cointop -it cointop/cointop server -k /keys/id_rsa

SSH demo

ssh cointop.sh