PowerShell / PowerShell/Win32-OpenSSH

Cached Credentials Authentication For Domain User

Open
#1,889 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Hello,

Scenario:
I have a local network, I use other-computer to ssh into windows-computer using openssh-server. On windows-computer my session is a domain user it authenticates through Active directory on a domain controller.

Issue:

  • When I am connected to internet (online):
    • When I ssh from other-computer to windows-computer on local network, I have noticed that ssh authentication lags a bit because it authenticates remotely to the domain controller.
    • ssh user@windows-computer-ip (works)
  • When I am offline:
    I can't ssh anymore from other-computer to windows-computer. The other-computer error message is "Connection reset by windows-computer port port-number". The windows-computer error message in event viewer is "sshd: fatal: ga_init, unable to resolve user domain\user".
  • The closest ticket I found related to that issue is https://github.com/PowerShell/Win32-OpenSSH/issues/1363 for users @xf6jx5fq and @shawnz

Explanation:

    PrincipalContext pcon = new PrincipalContext(ContextType.Machine, Environment.MachineName);
    var password_ok = pcon.ValidateCredentials("domain\\user", password);
  • I also tried unsuccessfully to include the computer name in the ssh command because that is what Environment.MachineName provides. ex: ssh user@windows-computer-name@windows-computer-ip

Questions:

  • Can I authenticate in openssh-server using cached credentials using an ssh command parameter?
  • Is there a setting on openssh-server that allows using cached credentials instead of connecting to remote?
  • Can the issue be solved by a Windows group policy, or Windows settings?
  • If question 1, 2, 3 return false then is there a way to implement a custom authentication mechanism on openssh-server on Windows as a work-around. If not did you plan adding cached credentials authentication feature?

Any help or information on that issue is appreciated.

Thanks,

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the reported offline failure, the “sshd: fatal, ga_init” event, and the linked issue 1363. Compare the requested cached-credential behavior with the existing Windows OpenSSH authentication flow; done would require a clearly defined supported approach, configuration or command behavior, and validation for offline domain-user authentication.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
authentication, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.