2

As known OpenSSH Server on Windows 10 (sshd.exe) run as a service by default. But there are cases that require to run OpenSHH Server in an interactive Windows session, not in session 0 by default. For example, let's assume you connect to Windows from some Linux/Android and you don't want to use Desktop connections like VNC and others. And then it's impossible to run the command such rundll32.exe user32.dll,LockWorkStation via SSH successfully as LockWorkStation function requires Desktop session i.e. session 1, session 2, etc. And

Sometime ago I found a post stated that it's possible to run SHH Server on Windows interactively but no specific instructions were given then:

You can run the SSH server in an interactive Windows session, instead as a service. It has its limitations though.

Now I'm looking for those one.

I tried to run sshd.exe directly through cmd with configuration file and log like

c:\Windows\System32\OpenSSH\sshd.exe -f c:\Windows\System32\OpenSSH\sshd_config_default -E log.txt

but launched this way server doesn't support any incoming connection. The log file contains very little information:

Accepted password for The_Immortal from ::1 port 28532 ssh2
CreateProcessAsUserW failed error:1314
fork of unprivileged child failed

Unfortunately there is no proper help built in sshd.exe. It only shows general list of arguments

usage: sshd [-46DdeiqTt] [-C connection_spec] [-c host_cert_file]
            [-E log_file] [-f config_file] [-g login_grace_time]
            [-h host_key_file] [-o option] [-p port] [-u len]

And I'm frustrating what's necessary from this to finally run sshd.exe interactively?


UPD: I've just found a big workaround similar to my question but it concerns some customized (upgraded) OpenSSH Server. Anyway with sshd -d I have the same error as above.

7
  • You are sure this comment about Interactive mode was for OpenSSH Server on Windows, using the Windows Feature, because the version of OpenSSH installed by that feature does not have every feature that regular old OpenSSH Server has. There are many features it does not have. Can you provide a link to the statement, without context, it's not possible to determine if your understanding of the comment was correct. Edit your question instead of submitting a comment.
    – Ramhound
    Mar 13 '20 at 21:35
  • Your link does not work. It's not even a URL to a website.
    – Ramhound
    Mar 13 '20 at 21:42
  • @Ramhound fixed. Well, actually you are right. The author didnt't mean OpenSSH Server exactly. But I decided there is a way to lauch it interactivelly. Mar 13 '20 at 21:44
  • The Windows OpenSSH Server optional feature, as I said, is not a feature-complete port. Did you look into psexec?
    – Ramhound
    Mar 13 '20 at 22:50
  • @Ramhound SSH is my choice as I'm looking for cross-platform solution as I need to send command from Android as well. Till now there is no PsExec port under Android. Could you please explain what you mean by "regular old feature-complete OpenSSH Server"? Where can it be found? Mar 13 '20 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.