SSH. Account rights for AcceptEnv

Андрей Михалевский 3,396 Reputation points
2024-11-11T08:38:46.2166667+00:00

Hi. I am using ssh on windows server 2019.

In the C:\ProgramData\ssh\sshd_config I am using

  • AcceptEnv

This works when the account is a local administrator.

Although the documentation says this is not supported: OpenSSH Server configuration for Windows | Microsoft Learn

It works. I think the documentation is just not updated.

But if the account is not the local administrator, it doesn't work.

What permissions does the account need to use

  • AcceptEnv

?

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,832 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Daisy Zhou 26,401 Reputation points Microsoft Vendor
    2024-11-12T07:21:18.01+00:00

    Hello

    Thank you for posting in Q&A forum.

    The official documentation for OpenSSH on Windows does state that the AcceptEnv directive is not supported. This can be confusing, especially since you've observed it working under certain conditions.

    The discrepancy might be due to the way OpenSSH is implemented on Windows compared to Unix-like systems. While some features might appear to work, they aren't officially supported and could lead to inconsistent behavior, particularly with non-admin accounts.

    To ensure reliable and secure operation, it's best to follow the official guidelines. If you need to pass environment variables, you might consider alternative methods, such as:

    1. Using PowerShell Profiles script.
    2. Group Policy.
    3. Login Scripts.

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.