All Projects → nknorg → nkn-shell-daemon

nknorg / nkn-shell-daemon

Licence: other
NKN shell daemon

Programming Languages

javascript
184084 projects - #8 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to nkn-shell-daemon

privacy-preserving-primitives
primitives and protocols for implementing privacy preserving networks
Stars: ✭ 14 (-51.72%)
Mutual labels:  distributed-systems, p2p
rdoc
Conflict-free replicated JSON implementation in native Go
Stars: ✭ 76 (+162.07%)
Mutual labels:  distributed-systems, p2p
nkn-sdk-js
JavaScript Implementation of NKN Client and Wallet SDK
Stars: ✭ 34 (+17.24%)
Mutual labels:  p2p, nkn
nconnect
Securely connect to remote machines without the need of any server, public IP address, or publicly exposed ports.
Stars: ✭ 38 (+31.03%)
Mutual labels:  p2p, nkn
Go2p
Simple to use but full configurable p2p framework
Stars: ✭ 80 (+175.86%)
Mutual labels:  distributed-systems, p2p
Nkn
Official Go implementation of NKN full node.
Stars: ✭ 287 (+889.66%)
Mutual labels:  distributed-systems, p2p
Layr
A decentralized (p2p) file storage system built atop Kademlia DHT that enforces data integrity, privacy, and availability through sharding, proofs of retrievability, redundancy, and encryption, with smart-contract powered incentive scheme
Stars: ✭ 90 (+210.34%)
Mutual labels:  distributed-systems, p2p
Testground
🧪 A platform for testing, benchmarking, and simulating distributed and p2p systems at scale.
Stars: ✭ 216 (+644.83%)
Mutual labels:  distributed-systems, p2p
Cause
An EDN-like CRDT (Causal Tree) for Clojure & ClojureScript that automatically tracks history and resolves conflicts.
Stars: ✭ 68 (+134.48%)
Mutual labels:  distributed-systems, p2p
Nkn Client Js
[Deprecated, use nkn-sdk-js instead] JavaScript implementation of NKN client
Stars: ✭ 53 (+82.76%)
Mutual labels:  distributed-systems, p2p
Diztl
Share, discover & download files in your network 💥
Stars: ✭ 162 (+458.62%)
Mutual labels:  distributed-systems, p2p
research
research, notes & ideas on various subjects
Stars: ✭ 54 (+86.21%)
Mutual labels:  distributed-systems, p2p
protoactor-go
Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
Stars: ✭ 4,138 (+14168.97%)
Mutual labels:  distributed-systems
tensorpeers
p2p peer-to-peer training of tensorflow models
Stars: ✭ 57 (+96.55%)
Mutual labels:  p2p
SentryPeer
A distributed peer to peer list of bad actor IP addresses and phone numbers collected via a SIP Honeypot.
Stars: ✭ 108 (+272.41%)
Mutual labels:  p2p
awesome-list-of-awesomes
A curated list of all the Awesome --Topic Name-- lists I've found till date relevant to Data lifecycle, ML and DL.
Stars: ✭ 259 (+793.1%)
Mutual labels:  distributed-systems
gen browser
Transparent bi-directional communication for clients, servers and more
Stars: ✭ 67 (+131.03%)
Mutual labels:  distributed-systems
matchbox
Painless peer-to-peer WebRTC networking for rust wasm
Stars: ✭ 276 (+851.72%)
Mutual labels:  p2p
torrent-spider
基于DHT的p2p网络资源爬虫
Stars: ✭ 65 (+124.14%)
Mutual labels:  p2p
go-pdu
Parallel Digital Universe - A decentralized social networking service
Stars: ✭ 39 (+34.48%)
Mutual labels:  p2p

NKN Shell Daemon

NKN shell daemon (nshd) is a Node.js application that uses nkn-multiclient-js to listen for incoming shell command from authenticated users, executes, and send back results through nkn-client. It is similar to sshd but has a few fundamental difference:

  1. Network transparent: NKN address is used instead of IP address, so host machine can freely change IP address without being affected.

  2. Higher security: Communication is through nkn-client where public key is part of the nkn address, so everything is end to end encrypted without the need to fetch or trust public key separately. This protocol eliminates man-in-the-middle (MITM) attack caused by mismatch of address and public key.

  3. No open port: Host machine running nshd does not need to open any port or have a public IP address. All connections are outbound instead of inbound. This makes nshd even more secure and convenient.

  4. Cross platform compatibility: It just takes a few lines of code to send commands and receive results in any language supporting NKN client SDK.

Get Started

The fastest way to get started is to run nshd with one of the following client:

But you still need to add your client public key to authorized_pubkeys, see the next section.

Configurations

Address and Identity

When nshd starts, it will read /etc/nshd/wallet.json and /etc/nshd/wallet.pswd to get NKN wallet file and password. If wallet file does not exist, it will generate a random wallet and password and save to that location. The wallet file is compatible with NKN node and wallet SDK.

After nshd gets the wallet, it will print out its NKN address in stdout where you can send command to and receive results from. By default it's just the wallet public key, but you can choose the identifier part of the NKN address using --identifier=xxx argument when launching nshd.

Permission Control

Similar to sshd, nshd will read authorized public keys or addresses from /etc/nshd/authorized_pubkeys. Only message from these public keys will be handled. Content of authorized_pubkeys should follow the scheme:

authorized_public_key_or_addr_1 [uid] [gid]
authorized_public_key_or_addr_2 [uid] [gid]

If a public key is given, then all NKN addresses from that public key (with any identifier) will be accepted. If an address is given, then only that specific address will be accepted. Both uid and gid are optional and controls the user and group of the process used to execute commands. If uid and gid are not given, user/group where nshd process belongs to will be used.

Sending Commands and Receiving Results

Sending commands is as simple as using nkn-multiclient-js or other client implementations to send a JSON message to nshd's listening NKN address. The JSON message can have the following fields:

  • cmd Shell command to execute.

  • execSync If true, results will be returned in message reply, otherwise results will be sent in a separate message. Default: false.

  • execTimeout In milliseconds the maximum amount of time the process is allowed to run. Default to 5000 if execSync is true, or 0 (unlimited) if not. The default value can be changed by --syncexectimeout=xxx and --asyncexectimeout=xxx argument when launching nshd.

The execution results will be returned as reply if execTimeout is true, or as a separate message if execTimeout is false. The results is a JSON message with the following fields:

  • stdout The stdout of the process running the command.

  • stderr The stderr of the process running the command.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].