SONM supplier may get SSH access to remote worker (SSH session for user 'root' to the host OS) even if worker PC works behind the NAT and has no public IP.
To make this possible, you should install SONM to your PC (from where you willing to get access to your worker PC, for example your laptop).
Installing SONM to the administrative PC
NOTE: Your administrative PC should have Linux OS (Debian-based, for example Ubuntu). Windows users may try VM with Linux (Oracle VirtualBox, for example).
You need only SONM Node and CLI components to be installed on your administrative PC, but they must work with your 'master' key.
sudo mkdir -p /etc/sonm/sonm-keystore
Put the keystore file to this folder. Folder must contain only one key.
sudo bash -c "$(curl -s https://raw.githubusercontent.com/sonm-io/autodeploy/master/sonm-auto-deploy-consumer.sh)"
sudo systemctl stop sonm-node && sudo systemctl disable sonm-node
sudo nano /etc/sonm/node-default.yaml
This will run text editor 'nano'.
Add this section at the end of the file:
ssh:
# Endpoint where the local SSH server will be exposed.
endpoint: localhost:2222
# NAT punching settings.
npp: *npp
Save the file (Ctrl-O) and quit (Ctrl-X).
eval $(ssh-agent -s) && ssh-add $HOME/.ssh/id_rsa && sonmnode --config=/etc/sonm/node-default.yaml
You will be asked for a passhprase (your 'master' key password).
If you get error like '/home/
/.ssh/id_rsa: No such file or directory ', you should create RSA key for SSH, just run the commandssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''
.
Run SONM Node (step #6 from the section above).
ssh <worker_eth_addr>@localhost -p 2222
Example:
ssh [email protected] -p 2222
NOTE: You can copy your worker address from SONM GUI (Market > Workers).
You can manage your workers remotely, if you have SONM Node running with your 'master' key. You do not need to open SSH to worker for this. For example, you may:
Open your keystore for SONM CLI with following command:
sonmcli login <your_master_eth_addr>
You will be asked for a passhprase (your 'master' key password).
Now you also may perform remote worker management and use all CLI commands.
For example, use following command to check worker status:
sonmcli worker status --worker-address=<worker_eth_addr>
See SONM CLI guide for additional info.