This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Lyqyd's profile picture

nsh - Now With Previous Session Resume!

Started by Lyqyd, 26 November 2012 - 10:05 AM
Lyqyd #1
Posted 26 November 2012 - 11:05 AM
nsh, or Net Shell, is an advanced remote shell program that you can use to control any computer remotely! Simply install nsh on both computers and run it in hosting mode on the machine you'd like to connect to.

nsh features:
  • Connect any combination of advanced computer, regular computer and turtle.
  • See the remote shell as if you were at that computer.
  • Use the hosting computer's local shell like nothing is different.
  • Run specific programs for incoming sessions and the local session (authentication!).
  • Transfer files between client and server (requires get and put programs).
  • Client file protection prevents server from overwriting local files.
  • Forward connections seamlessly (connect to another computer from a remote session).
  • Resume a previous remote session you had forcefully disconnected from.
Screenshot of an advanced computer connected to a turtle:
Spoiler

To specify a program to run for each client that connects (like an authentication program), as well as a program to run locally, use the following command. Both of these options default to /rom/programs/shell.

nsh host [outbound] [local]

The best way to get nsh is via packman, with the command packman install nsh, as this will fetch nsh and its dependencies automatically. You could also grab it from pastebin:

nsh: X5Fysdi4, or simply: pastebin get X5Fysdi4 nsh
framebuffer (suggested)I: Aaza6h5v, or simply: pastebin get Aaza6h5v framebuffer

You can start nsh with nsh host on the server computer and nsh <serverID> on the client.

nsh comes with the ability to send and receive files! You can add the get (KJ9Tu2Y9) and put (zeS6uFY7) programs (also available via packman as nsh-get and nsh-put, respectively) to the nsh host and connected clients can use these to send and receive files. The syntax is from the client's perspective, so running get file1 file2 while connected will get file1 from the server and save it as file2 on the client. When saving files to the client, you cannot overwrite existing files. This is to prevent the possibility of a rogue nsh server luring clients into connecting, then overwriting their startup with something nasty without asking the client. Binary files are also now somewhat supported. There are binary versions of the get and put programs available on the github repository. The put program works quite well, but the get program needs to be given a moment or two to save the file to prevent some odd behavior or disconnections due to the nature of the binary file writing procedure.

With the addition of the framebuffer API (you do not need to separately install it if you have LyqydOS installed, it will find that copy), nsh can now handle session resuming. When connecting to a server, simply type nsh <server> resume to resume a previous session. If no previous session is available, you will simply start a new session. This is the only way to prevent killing a process started in a previous session when reconnecting. The framebuffer API being present also provides a significant reduction in rednet usage, so you should notice better responsiveness on slower connections. Of course, the framebuffer API is not required, but you will notice significant benefits to having it present.

Also available is a small nsh API that programs on the server can use. It exposes the following functions while nsh is running:


nsh.getRemoteID() --returns the computer ID of the client who is connected to the session the function is called from, or nil if called from local session.
nsh.send(<message>) --sends a rednet message to the connected client.
nsh.receive([timeout]) --returns any messages received from the connected client that are not intercepted by nsh itself.  For instance, you cannot receive the event packets with this method.
nsh.getClientCapabilities() --requests the capabilities string from the connected client. Returns nil if a response is not received within one second.
nsh.getRemoteConnections() --fetches a list of all directly connected computers.

A sample authentication program, available via packman as nsh-auth or fetchable from pastebin: ySEWczEr or simply: pastebin get ySEWczEr auth
Spoiler

local pass = "fooBarBaz"
term.clear()
term.setCursorPos(1,1)
print("remote@"..(os.getComputerLabel() or os.getComputerID()))
term.write("Login Required: ")
if read("*") == pass then
  shell.run("rom/programs/shell")
end

I will be further extending nsh in the (hopefully near) future to be able to run programs on the client to handle responses from programs running on the server, to further extend the capabilities beyond what can reasonably be built into nsh itself.
Lyqyd #2
Posted 26 November 2012 - 02:55 PM
If you had previously downloaded nsh, please re-download, as I've fixed an unpleasant bug causing the client to hang when exiting from the shell, requiring manual termination. The correct, updated version is at the same pastebin ID.
BigSHinyToys #3
Posted 26 November 2012 - 04:50 PM
while I wouldn't call this the first http://www.computercraft.info/forums2/index.php?/topic/2817-remote-terminal-logincontroll-system/ I would call it the best.

One small problem if you run a program the redirects terminal then it causes issues.
Lyqyd #4
Posted 26 November 2012 - 05:11 PM
Ah! Interesting that I missed that, then. Though, yours seems to hook os.pullEventRaw() to use the existing shell session to send events to, while mine spawns a new shell session per connection and manages these coroutines.
BigSHinyToys #5
Posted 26 November 2012 - 05:21 PM
Ah! Interesting that I missed that, then. Though, yours seems to hook os.pullEventRaw() to use the existing shell session to send events to, while mine spawns a new shell session per connection and manages these coroutines.
It was kind of a proof of concept and not a full functional program. It did as you say in hocking the existing shell and not starting a new shell instance.
It was terribly unstable and couldn't work even through the most basic of network routing systems.
dissy #6
Posted 26 November 2012 - 05:36 PM
The names of these programs keep getting more random the more I look at them .-.

This is offtopic I know, but there is a long tradition of shell naming such as this one that goes back decades in the Unix world.
'sh' is short for shell, and was the name of the first shell in Unix.
Later came csh, for the C Shell (Named after the programming language, heavily tied in with Unix)
Then 'bash', the Borne Again shell, also the standard shell on most Linux systems out there today.
There is 'rsh' for the remote shell, one of the first networkable control systems made.
Today it's replacement is 'ssh', the secure shell, used to remotely manage Unix servers and other systems all over the world using public key encryption.

'nsh' for the network shell is a quite apt name, following this long tradition :}

One which I can't wait to try out. Thank you Lyqyd!
Dlcruz129 #7
Posted 26 November 2012 - 07:00 PM
Would that be pronounced "oonsh"? :P/>
Lyqyd #8
Posted 26 November 2012 - 07:14 PM
Would that be pronounced "oonsh"? :P/>

I'd say that using it as a word, it'd be "nish" or "nesh" most likely. You could also go with the "en-ess-aych" or "net shell" pronunciations.

Thanks, dissy! Hope it proves useful.
Lyqyd #9
Posted 27 November 2012 - 03:30 PM
Updated to use the EV packet type and structure instead of custom-packing the event. See the TRoR RFC for discussion.
Bubba #10
Posted 27 November 2012 - 06:16 PM
Pretty interesting code - I like your execution of this. I started writing a remote VNC program this past week but it looks like this basically does all of that and more. Keep up the nice work :)/>
Lyqyd #11
Posted 28 November 2012 - 03:01 PM
New update today adds a handy feature: custom paths upon connection, and for the local shell. This enables things like authentication, by means of running a program beforehand to ask the connected user for a password, before running the shell. New usage is:

nsh host [program to run upon connection] [program to run locally]

Both options default to /rom/programs/shell, so no need to set any options if you just want a simple nsh session.
rhyleymaster #12
Posted 28 November 2012 - 08:41 PM
off topic: Is he tittle the result of you smashing your face on the keyboard once???
On topic: Nice program.
GopherAtl #13
Posted 04 December 2012 - 07:19 PM
why all the name-bashing? it's a damned handy little utility. Ever needed to change the software in a gps sattelite placed by a turtle at y=255 in survival mode? nsh beats the hell out of programming a turtle to go update it for you.
Dlcruz129 #14
Posted 05 December 2012 - 05:17 PM
We're not name-bashing, it's just funny.
Lyqyd #15
Posted 23 December 2012 - 10:38 AM
New update today fixes a bug wherein two computers hosting nsh couldn't connect to each other. Download is at the same pastebin code from the original post.

Please note that attempting to connect two computers to each other at the same time through nsh (client sessions in both directions) does not work.
ObtusePenguin #16
Posted 27 December 2012 - 10:01 PM
I know you guys may not want to hear this, but could you give a more detailed description of how to install/operate this shell if you have time?

Reason I ask is that I'm new to ComputerCraft and am trying to learn for the sake of having a server and client setup, where servers send messages to clients (either other computers, or turtles), and from what i understand, something like this can help me. I know VERY basic Lua but judging from the above comments this can be used to do something along the lines of what I require…

Thank you so much.
Lyqyd #17
Posted 28 December 2012 - 04:50 AM
Basically, you put the nsh program (available from the pastebin link in the first post) on each computer you want to connect to or from with it. Then, on the computer(s) you wish to connect to, simply type: nsh host. The screen will clear and a fresh shell will appear if it starts correctly. You'll need the ID of this computer, so type: id. Remember that number. Now, go to any other computer that has nsh installed and type nsh and the ID of the first computer. For instance, to connect to computer 12, type: nsh 12. Type exit when finished to disconnect, or use ctrl-T to disconnect without ending the session (reconnecting will end the previous session and start a new one).

You can also specify programs to run, both for new connections, and for the local computer. You might write an authentication program that requires a password before starting the shell and use it for incoming connections. You can specify these:

nsh host [remote [local]]

Both options default to /rom/programs/shell. For example, if your authorization program was named auth, you might run:

nsh host auth rom/programs/shell

Or just:

nsh host auth

Hope that helped! Feel free to post any more questions you might have.
ObtusePenguin #18
Posted 28 December 2012 - 06:35 AM
Basically, you put the nsh program (available from the pastebin link in the first post) on each computer you want to connect to or from with it. Then, on the computer(s) you wish to connect to, simply type: nsh host. The screen will clear and a fresh shell will appear if it starts correctly. You'll need the ID of this computer, so type: id. Remember that number. Now, go to any other computer that has nsh installed and type nsh and the ID of the first computer. For instance, to connect to computer 12, type: nsh 12. Type exit when finished to disconnect, or use ctrl-T to disconnect without ending the session (reconnecting will end the previous session and start a new one).

You can also specify programs to run, both for new connections, and for the local computer. You might write an authentication program that requires a password before starting the shell and use it for incoming connections. You can specify these:

nsh host [remote [local]]

Both options default to /rom/programs/shell. For example, if your authorization program was named auth, you might run:

nsh host auth rom/programs/shell

Or just:

nsh host auth

Hope that helped! Feel free to post any more questions you might have.

Thank you tons for this detailed explanation. I'm going to give it a shot and I'll report my feedback :)/>
ObtusePenguin #19
Posted 28 December 2012 - 10:17 PM
Okay, so i've tried this, but any time I run "nsh <ID>" it returns 'Connection failed'. I have rednet modems on the wireless turtles, as well as the computer itself. Or does this not work with turtles?

To clarify:

I first install nsh on a turtle, then run 'nsh host'

Then I move to the server computer, and type 'nsh <id of turtle>'

The above procedure returns 'Connection failed'
Lyqyd #20
Posted 29 December 2012 - 06:18 AM
Okay, so i've tried this, but any time I run "nsh <ID>" it returns 'Connection failed'. I have rednet modems on the wireless turtles, as well as the computer itself. Or does this not work with turtles?

To clarify:

I first install nsh on a turtle, then run 'nsh host'

Then I move to the server computer, and type 'nsh <id of turtle>'

The above procedure returns 'Connection failed'

Well, that is strange indeed. Are your turtle and computer within rednet range of each other? Default range at sea level is 64 blocks; 16 during a storm. I have successfully connected to a wireless turtle before, so I know that that is not an issue. If it's not a range issue, I've got a little utility I can put up on pastebin tonight that can log the connection attempt, which will make it easier to analyze the fault.

Also, do you have any kind of rednet API or OS or some such installed that might be interfering with or intercepting rednet traffic?
Mendax #21
Posted 11 January 2013 - 12:21 AM
May I use this in my OS? It's the last thing I need. I might also make a front-end for it if you don't mind :)/>
Lyqyd #22
Posted 11 January 2013 - 05:01 AM
May I use this in my OS? It's the last thing I need. I might also make a front-end for it if you don't mind :)/>

You're welcome to include nsh as-is in whatever you like. You may also create a derivative program, though I would ask that you make it nsh-compatible if you do (that is, your front-end should be able to connect to a standard nsh server and operate correctly, or have clients connect to it and operate correctly, if it's a server front-end). :)/>
Mendax #23
Posted 11 January 2013 - 02:03 PM
You're welcome to include nsh as-is in whatever you like. You may also create a derivative program, though I would ask that you make it nsh-compatible if you do (that is, your front-end should be able to connect to a standard nsh server and operate correctly, or have clients connect to it and operate correctly, if it's a server front-end). :)/>
By frontend I mean a GUI. I may also include some server-side software for it.
Lyqyd #24
Posted 11 January 2013 - 05:58 PM
nsh has been updated to include file transfers! See the first post for details and the required additional programs.

You're welcome to include nsh as-is in whatever you like. You may also create a derivative program, though I would ask that you make it nsh-compatible if you do (that is, your front-end should be able to connect to a standard nsh server and operate correctly, or have clients connect to it and operate correctly, if it's a server front-end). :)/>
By frontend I mean a GUI. I may also include some server-side software for it.

Oh, a gui for it? I'm curious as to how that would work! :)/> Funny you should mention server-side software for it, as I just added a little API to it and plan to further extend nsh's capabilities to handle extra stuff client-side. There are exciting changes in the pipeline.
Mendax #25
Posted 12 January 2013 - 08:19 AM
I look forward to it. It's gonna just be a mouse click and type interface. Nothing that special.
pielover88888 #26
Posted 20 January 2013 - 02:43 PM
Is it just my laggy computer, or does editing a large file or..doing anything..slowly print whatever's happening, word by word?
Lyqyd #27
Posted 20 January 2013 - 04:26 PM
Things are going to be a little bit slower when doing things over nsh, as there's the obvious overhead of transmitting all the key events to the nsh host, and receiving all the screen drawing instructions back. I haven't noticed it being too much of a problem, but obviously, if you're already on a relatively slow server, it's only going to be compounded by needing to interact with two computers at once. One thing you might try if you have the latest version is using the get and put commands (programs available in the first post) to retrieve the file from the nsh host and edit it locally, then put it back on the host computer again. Is editing the file locally a little slow also?
twitch204 #28
Posted 21 January 2013 - 04:25 PM
Hi,
I downloaded NSH to two computers. With the one I put in nsh host and got the following error "bios:267 attempt to write to gobal. Installed on a few others and keep getting the same error.
Lyqyd #29
Posted 21 January 2013 - 04:32 PM
Hi,
I downloaded NSH to two computers. With the one I put in nsh host and got the following error "bios:267 attempt to write to gobal. Installed on a few others and keep getting the same error.

What version of ComputerCraft are you on?
twitch204 #30
Posted 21 January 2013 - 05:16 PM
1.3 with tekkit classic using the launcher.
Lyqyd #31
Posted 21 January 2013 - 05:31 PM
1.3 with tekkit classic using the launcher.

Try changing line 248 from this:


_G.nsh = nshAPI

to this:


rawset(_G, "nsh", nshAPI)
twitch204 #32
Posted 21 January 2013 - 08:39 PM
ok, i changed the line and am now getting the error "bios:206: [string "nsh"]:127: unexpected symbol
Lyqyd #33
Posted 22 January 2013 - 04:29 AM
ok, i changed the line and am now getting the error "bios:206: [string "nsh"]:127: unexpected symbol

Hmm, that change should not have resulted in that error. Is it possible you accidentally changed something else in the code while you were changing line 248? I will look into this tonight and see if I can reproduce the error.
twitch204 #34
Posted 22 January 2013 - 05:36 AM
I dont think so, i did highlight, and pasted over it. When I get home ill redownload and try again. If you need access to the server or the cfg let me know. Thank you for helping me with this!
Ciesson #35
Posted 02 February 2013 - 05:47 AM
I must say, brilliant work mate! This is code at its finest.

Except for a typo I found on line 413:
elseif pacektType == "data" then

This hasn't crashed me yet, so it might just be an artifact.

Again, lovely work!
Lyqyd #36
Posted 02 February 2013 - 06:38 AM
I must say, brilliant work mate! This is code at its finest.

Except for a typo I found on line 413:
elseif pacektType == "data" then

This hasn't crashed me yet, so it might just be an artifact.

Again, lovely work!

Awesome! I'm glad you're liking it. :)/>

If I recall correctly, that is probably code that's stubbed in for future functionality (would be used for client-side nsh extensions), so it shouldn't cause any issues. I will certainly get that fixed when I flesh out the extensions code, though. Thanks for the report!
Ciesson #37
Posted 03 February 2013 - 09:57 PM
You don't mind if I fork this and make a secure version of it? I am currently working on a PKI system and I have a relatively fast AES library that I plan to use.
Lyqyd #38
Posted 05 February 2013 - 04:26 AM
You don't mind if I fork this and make a secure version of it? I am currently working on a PKI system and I have a relatively fast AES library that I plan to use.

It's on github for a reason. :)/>
Lyqyd #39
Posted 16 February 2013 - 11:16 AM
Here's a small authorization program you might use for asking for a password in incoming connections:


local pass = "fooBarBaz"
term.clear()
term.setCursorPos(1,1)
print("remote@"..(os.getComputerLabel() or os.getComputerID()))
term.write("Login Required: ")
if read("*") == pass then
  shell.run("rom/programs/shell")
end

The code should be pretty obvious–they get one chance at getting the password correct. If they get it wrong, they are immediately disconnected. If they get it correct, a new shell session is started. If you named the program "auth", you would use it with `nsh host auth` or `nsh host auth shell` or similar, so that it will be run for all incoming connections.
Lyqyd #40
Posted 22 February 2013 - 07:56 AM
A new version of nsh is available. This version fixes a bug related to the rednet change in ComputerCraft 1.5. If you have computers that are not easily accessible, I would advise you to update nsh on these computers prior to updating to ComputerCraft 1.5. Any computers running any older versions will be non-responsive in ComputerCraft 1.5. I apologize for any inconvenience this causes.
Lyqyd #41
Posted 11 May 2013 - 04:23 PM
Update to nsh today adds Connection Forwarding, for seamless connections when passing through another server.
Lyqyd #42
Posted 20 October 2013 - 01:18 AM
I've just updated this to add in support for the framebuffer API, which adds a number of nice features:
  • Better responsiveness
  • Less chatty on rednet
  • Resume previous sessions (if ended with Ctrl-T/R/S at the client)
Also new is tentative support for binary file transfer (using binget and binput files from the github repository), use with caution.

As usual, see first post for more details.
natedogith1 #43
Posted 24 March 2014 - 02:33 AM
I have a bug report for your program. Tested in 1.6pr7 and a quick look at the pastebin to see if it was just an old release. Running nsh with no arguments tells me that I failed to connect to the server, rather than telling me how to actually use the program.
Lyqyd #44
Posted 24 March 2014 - 04:36 AM
You are correct! I'm away from my computer right now, but the change to correct the issue is to change line 564 from


elseif #args <= 2 then

To this:


elseif #args >= 1 then

Not sure why I had that wrong in there! I'll update the pastebin when I can.
CaptRanger #45
Posted 26 April 2014 - 08:23 AM
Is this on the list to get working on 1.6X?
Lyqyd #46
Posted 26 April 2014 - 04:36 PM
Yeah, if it's broken again on 1.6, I'll update it to fix it as soon as I can. I had gotten it working under the 1.6 betas, but I'll check again under the 1.63 release.
joebodo #47
Posted 12 May 2014 - 05:00 PM
Can you only connect to one remote computer at a time?

I connected to host 59 and when I try to connect to 40 as well (from a different shell), I get the message '59'.

I am using the command 'nsh <host ID>'

Thanks
Lyqyd #48
Posted 12 May 2014 - 08:00 PM
That should work fine, I will have to do some testing. I assume you're using multishell in the new version of CC?
joebodo #49
Posted 13 May 2014 - 06:43 PM
That should work fine, I will have to do some testing. I assume you're using multishell in the new version of CC?

Yes, multishell. I'm using CC 1.63.
Edited on 13 May 2014 - 04:43 PM
joebodo #50
Posted 14 May 2014 - 05:16 AM
One additional thing - I had to add a type = 'string' check on each message in the rednet_message event. I'm sending some non-strings as well and that was causing nsh to abort.

Not sure if others are having issues (couldn't find any posts in the bugs topic) - but rednet on our server only seems to work if there are at most 2 computers. So, i hacked in rednet from 1.58 and everything is working great.
RoD #51
Posted 26 May 2014 - 05:52 PM
I can't use the get/put programs (i already downloaded them and placed in the host pc) it frezes the client.
Lyqyd #52
Posted 06 October 2014 - 05:14 AM
I'm not sure how I missed your post, RoD, but the work I did recently with nsh/LyqydNet/LyqydOS ended up including a fix for the issue. If you re-download nsh and the get/put programs, you should find that they're working fine again.
lare290 #53
Posted 22 December 2014 - 07:36 PM
So I found this program on a floppy, from a dungeon :P/>
First I was like "Ooh floppy, it must be cool new game"
Then I was like "Oh damn, it is just something program I dun need"
Lupus590 #54
Posted 13 April 2015 - 01:10 PM
graphical bug report

the underscore is ment to be white (and is on the server, running vncd)

Edited on 13 April 2015 - 11:13 AM
LDDestroier #55
Posted 23 April 2015 - 03:10 AM
Hey Lyqyd, I'm making a server on my poweredge (which I just got working, damn RAID), and I put nsh in a resource pack to make it a default program. However I did have a small (fixed, but still) problem with the detection of the framebuffer API. I like the current detection system for it, but could you make it also look in the directory where the current program is running in? I had to add the "/rom/programs/" directory in the table where it looks. Cheers.
Lyqyd #56
Posted 23 April 2015 - 04:51 AM
I'll look in to adding that. Shouldn't be too difficult. If you were adding a resource pack, why not put framebuffer in /rom/apis, so it would be loaded at boot anyway? Then nsh won't have to look for it at all!
LDDestroier #57
Posted 27 April 2015 - 07:27 PM
I'll look in to adding that. Shouldn't be too difficult. If you were adding a resource pack, why not put framebuffer in /rom/apis, so it would be loaded at boot anyway? Then nsh won't have to look for it at all!

…you make a convincing argument.
Lupus590 #58
Posted 29 May 2015 - 10:48 PM
So I tried to do something stupid…

Two pocket computers, both running vncd.
the first connects to the second then (through the first) I connect the second to the first.
The first freezes, the second give the expected error of "can't connect".
Edited on 29 May 2015 - 08:51 PM
Lyqyd #59
Posted 30 May 2015 - 08:32 PM
I've pushed an update to vncd that fixes the looped connection issues. Seems I had forgotten to include the nsh API stub so that nsh could detect the looping condition! Whoops. If you had installed nsh &amp; vncd via Packman, I've also just changed the package layout for these tools. It won't change again, but this one time, you'd want to update it via packman remove nsh followed by packman fetch install nsh-get nsh-put vncd. If you didn't want the get and put programs, packman fetch install nsh vncd would work also.
Lupus590 #60
Posted 14 November 2015 - 06:46 PM
The usage printout is a bit unclear in my opinion. Also it looks like the documentation in the OP needs updating.
ry00000 #61
Posted 15 March 2016 - 12:58 PM
Uhm. Sounds like my virus could download a slightly tweaked version of the Nsh server to prevent termination and let the PC open to external attack.
Then I download Nsh and remotely dial into that computer.
Anavrins #62
Posted 15 March 2016 - 05:20 PM
Uhm. Sounds like my virus could download a slightly tweaked version of the Nsh server to prevent termination and let the PC open to external attack.
Then I download Nsh and remotely dial into that computer.
Good to know, except malicious code is not allowed on the forums.
And tbh, you're certainly not the first one to have had this idea.
Edited on 15 March 2016 - 04:23 PM
ry00000 #63
Posted 15 March 2016 - 07:00 PM
I know malware isn't allowed on the forums. I'm gonna keep the only copy of the source in the world for myself anyways.
LDDestroier #64
Posted 10 April 2016 - 08:33 PM
Hey lyqyd, nsh doesn't seem to work with my wireless mining turtle in Acora. It connects just fine, but once I press a button (that isn't enter, strangly), it says "Connection closed by server." I am running it with:

shell.run("nsh host shell shell turtbert")
Restioson #65
Posted 24 June 2016 - 09:04 AM
Doesn't seem to work O os (http://www.computercraft.info/forums2/index.php?/topic/23391-o/). Is this a bug on O's side or NSH's?
Lupus590 #66
Posted 24 June 2016 - 01:04 PM
Doesn't seem to work O os (http://www.computerc.&#46;&#46;/topic/23391-o/). Is this a bug on O's side or NSH's?

describe what you did and what the computer is doing
Androthia #67
Posted 30 October 2016 - 03:14 PM
Ok, so I've installed Framebuffer, AUTH, and NSH on Advanced Wireless Feller Turtle and labeled the turtle Farmer01

I also installed Framebuffer, AUTH, and NSH on Advanced Computer (with rednet modem) and labeled the computer Command01

On Farmer01 I type "nsh Command01" and I get a Connection Failed reply.

On Command01 I type "nsh Farmer01" and get the same thing.


I'm trying to understand how to get it to work so I can run a program on Farmer01 from Command01 and see its screen output in real-time.
Lupus590 #68
Posted 31 October 2016 - 08:37 AM
On Farmer01 I type "nsh Command01" and I get a Connection Failed reply.

nsh needs to be running in host mode on the turtle. nsh host if you get a new shell (command line) then it's worked

the label is not the same as the id. on the turtle type id the number returned is the id

as for connecting to the turtle from your computer, nsh <the number that id returned>
Lyqyd #69
Posted 31 October 2016 - 02:34 PM
And if you'd like to have auth work, you'll need to run `nsh host auth` on the farmer turtle, after editing auth to use the password you want. If you don't want/need the password authentication, just `nsh host` will do.
Akrej #70
Posted 19 March 2017 - 07:14 PM
Why does NSH writes "Connection closed by server"?

I enter it:

NSH local remote host <name>

NSH <id> - this computer

I have everything connected and downloaded
Lyqyd #71
Posted 19 March 2017 - 09:09 PM
The host syntax should be something like:

nsh host shell shell hostname

If you've labeled the computer, all you need is nsh host for a basic server.
Akrej #72
Posted 20 March 2017 - 05:13 PM
It works only by observing what they see directly shell.
I can't control your computer remotely

I entered

nsh host shell shell hostname

and

nsh 4

Loaded a shell CraftOS 1.7
Keys and click &amp;quot;Connection closed by server&amp;quot

I would like pc handled remotely
Edited on 20 March 2017 - 08:39 PM