OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Applications => Topic started by: Andi B. on October 30, 2022, 06:58:59 pm

Title: ssh - sshd
Post by: Andi B. on October 30, 2022, 06:58:59 pm
I want to set up a ssh server on my system. I've not much experience with SSH until now. I installed the openssh packages (yum install openssh-servers ..) but can't start the daemon.

I tried all combinations with or without path like p:\usr\sbin\sshd.exe or P:/usr/sbin/sshd.exe ... but I get always -
Code: [Select]
sshd re-exec requires execution with an absolute path

Anyone running successfully an ssh server on OS/2?
Title: Re: ssh - sshd
Post by: David McKenna on October 30, 2022, 08:54:22 pm
Hi Andi,

 Just tried it myself and got the same result (no previous experience here either). Strangely enough, the last commit by Sylvan on the 'openssh-portable' BWW github site had to do with absolute paths on OS/2 (March 9, 2021). So my guess is it wasn't enough (or not released in a binary). Probably worth filing a bug report...

Regards,
Title: Re: ssh - sshd
Post by: Dave Yeo on October 31, 2022, 06:20:15 pm
It seems to me that only a certain EMX build really worked, at least without too many dependencies. IIRC, EMX had better terminal support as well.
Title: Re: ssh - sshd
Post by: Jan-Erik Lärka on October 31, 2022, 09:38:59 pm
I do use ssh(d) on my machines to connect to/from.
Rewrote a rexx script for an earlier release for setup (installation, configuration and various program icons).
I have the new version installed, but use the previous until the new one behave as expected.
Title: Re: ssh - sshd
Post by: Dave Yeo on November 01, 2022, 03:54:59 am
I do use ssh(d) on my machines to connect to/from.
Rewrote a rexx script for an earlier release for setup (installation, configuration and various program icons).
I have the new version installed, but use the previous until the new one behave as expected.

Which version are you using? ssh --version might be informative
Title: Re: ssh - sshd
Post by: Jan-Erik Lärka on November 01, 2022, 06:36:30 pm
ssh -v

OpenSSH_5.3p1, OpenSSL 0.9.8k 25 Mar 2009
Title: Re: ssh - sshd
Post by: Edmund Wong on December 21, 2022, 05:20:19 am
I tried using Security/2 but there was a lot of stuff that didn't seem to work well.  So I am trying the openssh rpm
packages.

While I installed "openssh-server",  I too am having issues with getting it to work.
Unfortunately, a lot of the searches have brought me to *nix based solutions.

C:\usr\sbin\sshd gives me the same error as everyone; that is, "sshd re-exec requires execution with an absolute path"

Edmund


Title: Re: ssh - sshd
Post by: Rick Smith on December 28, 2022, 06:13:39 pm
Greetings,

I have been trying to get ssh to work for a year or so now, but it just wont behave or work correctly so I gave up on it..

Rick
Title: Re: ssh - sshd
Post by: Dave Yeo on December 28, 2022, 07:56:03 pm
Has anyone filed an issue at Bitwise's github? Things don't get fixed without the developers knowing there's a problem. My guess it did what the porter wanted so he was happy.
Title: Re: ssh - sshd
Post by: Sean Casey on January 09, 2023, 02:07:47 am
Haven't used OpenSSH server on OS/2, but the v.5.3 client worked well as did OS/2 ZOC with Linux OpenSSH v.7 servers.   It seems OpenSSH v.8.9 server, which I'm now using on my Linux machines, no longer allows a workaround for the older key exchanges/ciphers supported by OS/2.  Was using diffie-hellman and DSA with overrides in sshd_config, but these no longer work with OpenSSH v.8 with my config overrides.

Recently installed the OS/2 v.7 OpenSSH client, but I preferred using ZOC.  I need to look into the possibility of not passing my OS/2 term environment variable "os2ansi" with SSH as this causing me issues in Linux (e.g., seeing junk characters using vi).   

Update:  I manually set ANSI for my SSH session which helped with vi, but keyboard mapping is borked while working in vi.   Keyboard mapping is on the client side, so something is off on my v.7 OS/2 SSH client. I'll come back to this in the future as I don't need SSH on OS/2. 
Title: Re: ssh - sshd
Post by: SoundChaser on January 10, 2023, 06:42:34 pm
Thank you Sean for sharing your results!


Title: Re: ssh - sshd
Post by: Andi B. on February 21, 2023, 09:32:09 am
I just had the opportunity to test sshd on win. It shows the same message -
Code: [Select]
....apps\git\usr\bin] sshd
sshd re-exec requires execution with an absolute path
So this seems to be
- no bug or
- cross platform bug or
- a user command error or
- a feature.

This is with latest openssh which comes with the win git version from yesterday.

Maybe we simply do not know how to install/use sshd correctly?

Probably I've stated before I've nearly no clue about all these ssh things. But in the meantime I played a bit. I did successfully connect from OS/2 to one linux box with the openssh5.3 version. But still can't get a sshd running on OS/2.
Title: Re: ssh - sshd
Post by: Dave Yeo on February 21, 2023, 04:54:22 pm
OK, I got further, seems it expects the directory separators to be / and it doesn't understand drive letters.
Code: [Select]
H:\tmp>sh
# w:/usr/sbin/sshd
sshd re-exec requires execution with an absolute path
# cd w:
# pwd
w:
# /usr/sbin/sshd
sshd: no hostkeys available -- exiting.
#

So use sh.exe and make sure you are on the @unixroot drive. Pwd command says your current directory
Title: Re: ssh - sshd
Post by: Andi B. on February 22, 2023, 08:55:26 am
Thanks. I will make more test the next days/weeks.

Key creation works. Although I'm not sure were is the best place to keep them. %etc% (M:\mptn\etc or P:\etc - boot drive or unixroot) or %home% (E:\home\default) in my case. Have to play with this. But it clearly shows my decision to keep boot drive, rpm/%unixroot% and data separated on different drives may introduce additional problems linux guys do not have.
Title: Re: ssh - sshd
Post by: Dave Yeo on February 22, 2023, 04:49:48 pm
Not sure about the keys, I'd assume %HOME% or /@unixroot/etc.
sh does understand @unixroot,
Code: [Select]
H:\>sh
# /@unixroot/usr/sbin/sshd
sshd: no hostkeys available -- exiting.
and also ~ as %HOME%
Code: [Select]
# ls ~
Desktop  Downloads  FCCACHE.INI  kalendar  ml.xspf  rpmbuild  tea  vlcrc
#

Edit:  Also understands @tmpdir, as %TMP% or %TMPDIR%
Code: [Select]
# ls /@tmpdir/
dooble.exe                   etilqs_4yGYScugU0IZ2IH3MKBQ
etilqs_36wWySOaKwG594uBEuBx  runtime-root
#
Title: Re: ssh - sshd
Post by: Andi B. on February 26, 2023, 04:51:58 pm
I now can start sshd. F.i. from bash -
Code: [Select]
{0}[p:\etc\ssh] bash
P:\USR\BIN\bash.exe-5.0# /usr/sbin/sshd -D
Sort of connection does work but can't do anything like can be done on linux hosts.

I had to create keys with -
Code: [Select]
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
Title: Re: ssh - sshd
Post by: j on July 11, 2023, 12:43:49 am
sshd -D starts after the host keys are created (not sure what's the different between the above and ssh-keygen -A); but I can't login via password or by adding my private key to authorized_keys in my homedir). I'm using openssh-server from bitwise/netlabs; the latest to date.
Title: Re: ssh - sshd
Post by: Digi on November 22, 2023, 11:31:42 pm
sshd -D starts after the host keys are created (not sure what's the different between the above and ssh-keygen -A); but I can't login via password or by adding my private key to authorized_keys in my homedir). I'm using openssh-server from bitwise/netlabs; the latest to date.

I have the same problem. Has anyone managed to log in?