Remote access to MorphOS system
  • Moderator
    Kronos
    Posts: 1821 from 2003/2/24
    I want to run Shell commands/scripts on my Efika over the network, but I only found info on how to log into *nix from a MorphOS machine (RemoteShell).

    Documentation on that case isn't really available, so I'm at a loss how to start a sever on the MorphOS site.

    2nd issue would be what Shell/settings to use on the client side to make sure it all looks as it would under MorphOS (escape codes and such).


    3rd step would be setting up a connection over dyndns or similar, but thats a whole other issue.
    --------------------- May the 4th be with you ------------------
    Mother Russia dance of the Zar, don't you know how lucky you are
  • »18.11.18 - 10:20
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 1690 from 2003/3/5
    From: Poland
    There is no OpenSSH server for MorphOS so the first step would be porting that...
  • »18.11.18 - 14:05
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    zukow
    Posts: 486 from 2005/2/9
    From: Poland
    There are some telnetd packages on aminet.
  • »18.11.18 - 15:11
    Profile Visit Website
  • jPV
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jPV
    Posts: 1455 from 2003/2/24
    From: po-RNO
    ...but if insecure options are fine (you're just using these in your own LAN), then there are options.


    Installing a telnetd should work for a primitive remote shell on the machine. I don't remember if there are MorphOS native telnetd programs, but 68k ones should work as well.


    Or if you just want to launch certain commands on the remote machine and don't need the whole shell, then you can put an entry or entries to inetd, and make that launch the commands you want when you trigger it by connecting into a defined port.

    For example, I have one MorphOS Mac mini, which I use at parties to show an infoscreen, game competition results screen, and play music etc. I just connect it to a display and network, but don't use any keyboard or mouse in it, but control it via network with simple commands from another computer(s).

    On that remote Mac mini I basically have just configured inetd to launch a simple shell script (called "mosctrl") when I connect to a certain port on that machine via telnet or any other mean that outputs to a network port. I have configured it by this way:
    1) The wanted port (7979 in this case) is defined in ENVARC:sys/net/services: "mosctrl 7979/tcp"
    2) Then the script is defined in ENVARC:sys/net/inetd.conf: "mosctrl stream tcp dos bin - execute S:mosctrl ?"

    The actual script is placed in S:mosctrl, here's a part of it to get an impression. You can do pretty much anything in it:
    Code:
    .KEY COMMAND/A,DO/F
    If "<COMMAND>" EQ "reboot"
    Reboot
    EndIf
    If "<COMMAND>" EQ "shutdown"
    Shutdown
    EndIf
    If "<COMMAND>" EQ "pause"
    MOSSYS:C/LuaX S:MultiMeedio.lua Pause
    Quit
    EndIf
    If "<COMMAND>" EQ "next"
    MOSSYS:C/LuaX S:MultiMeedio.lua Next
    Quit
    EndIf
    If "<COMMAND>" EQ "info"
    Echo "*E[1mArtist: " NOLINE
    RXCmd JUKEBOX "GET ARTIST"
    Echo "Song: " NOLINE
    RXCmd JUKEBOX "GET TITLE"
    Echo "Album: " NOLINE
    RXCmd JUKEBOX "GET ALBUM"
    Echo "*E[0m" NOLINE
    Quit
    EndIf
    If "<COMMAND>" EQ "quit"
    RXCmd SAKUINFO QUIT
    Quit
    EndIf
    If "<COMMAND>" EQ "tulos"
    Run >NIL: Hollywood:System/Hollywood -quiet Work:Temp/Tulosruutu/TulosScreen.hws
    Quit
    EndIf
    If "<COMMAND>" EQ "sakuinfo"
    Run >NIL: Hollywood:System/Hollywood -quiet Work:Temp/SakuInfo/SakuInfo.hws
    Quit
    EndIf
    If "<COMMAND>" EQ "tulosupdate"
    RXCmd SAKUINFO UPDATE
    Quit
    EndIf



    Then I can just telnet to the remote machine to the port 7979 from other machines to launch the commands... or what I actually use, is to make premade commands with the Echo command to control the remote machine.

    I have made a whole new Ambient menu with CRABUM to control the remote machine, so I just select the wanted commands from a pull-down menu and don't need to type or remember anything.

    For example, typing this in the shell would reboot the remote machine:
    Echo "reboot" > TCP:remotemac/7979
    In CRABUM I use this line for the same:
    Run >NIL: Echo *"reboot*" > TCP:remotemac/mosctrl


    And of course the previous script could be changed to launch any command you enter into it, but I didn't dare to allow that to avoid accidents :)


    [ Edited by jPV 18.11.2018 - 17:19 ]
  • »18.11.18 - 15:15
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 1821 from 2003/2/24
    Guess I'll have to fiddle with telnet next week.

    Quite insecure over the net I assume but I'll find a solution for that too.


    Cos there is no way I will be porting *nix based netstuff anytime soon ;)
    --------------------- May the 4th be with you ------------------
    Mother Russia dance of the Zar, don't you know how lucky you are
  • »18.11.18 - 17:44
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Jeckel
    Posts: 123 from 2007/3/11
    I have an old Amiga running MiamiDX telnetd over the internet for more than 15 years now. It was never compromised in any manner. So I guess that the security issue in quite virtual unless your are specifically targeted.
  • »19.11.18 - 15:14
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    KennyR
    Posts: 433 from 2003/3/4
    From: #AmigaZeux, Gu...
    Quote:

    Kronos wrote:
    Guess I'll have to fiddle with telnet next week.

    Quite insecure over the net I assume but I'll find a solution for that too.


    Not quite insecure - extremely, laughably, horrrrrendously insure.

    Don't access it from the net. Use a VPN. It doesn't need to be hosted on MorphOS - a router or RaspberryPi solution for instance.
  • »19.11.18 - 18:53
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Tom01
    Posts: 154 from 2009/9/20
    You can encrypt Network-Ports with an ssh-tunnel / ssh port forwarding.

    [ Edited by Tom01 21.11.2018 - 14:53 ]
  • »21.11.18 - 13:52
    Profile Visit Website
  • fx
  • Caterpillar
    Caterpillar
    fx
    Posts: 25 from 2010/10/12
    Please keep us updated if you get any telnetd working well enough to be usable under MOS. I've spent quite some time getting a remote shell working with AmigaOS3.1 and found VCON to be the best of the very crappy telnetd-options available. I've had to hack together various solutions to get the keyboard to work well (backspace was a problem, and the arrows and even enter in some cases like vim). It worked better if I set my terminal to ISO-8859-1 rather then UTF-8.

    I would love to be able to access my MorphOS machine in the same way but when I did some testing I couldn't get VCON to work at all under MOS. I did play around with launching ksh from inetd but there where too many problems for me to get it usable.

    And yeah, having telnet open on a machine connected directly to the internet is probably a very bad idea in this day and age, I only have it accessible on my local LAN so I have to SSH another machine first and then connect to it.
  • »29.11.18 - 20:21
    Profile Visit Website