tis-openssh-server icon

OpenSSH Server

Paquet d’installation silencieuse pour OpenSSH Server

9.5.0.0-0

  • package: tis-openssh-server
  • name: OpenSSH Server
  • version: 9.5.0.0-0
  • categories: system
  • maintainer: Bertrand Lemoigne, Tranquil IT
  • target_os: windows
  • impacted_process: sshd
  • architecture: x86
  • signature_date:
  • size: 4.59 Mo
  • homepage : https://github.com/PowerShell/Win32-OpenSSH/

package           : tis-openssh-server
version           : 9.5.0.0-0
architecture      : x86
section           : base
priority          : optional
name              : OpenSSH Server
categories        : system
maintainer        : Bertrand Lemoigne, Tranquil IT
description       : OpenSSH Server
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 
sources           : https://github.com/PowerShell/Win32-OpenSSH/releases/latest
installed_size    : 
impacted_process  : sshd
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : https://github.com/PowerShell/Win32-OpenSSH/
package_uuid      : 460a9b46-46df-41b4-bc47-f4426b6d60ce
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 10
max_os_version    : 
icon_sha256sum    : 9420721210f5d9c50c9e35c9fdbf0a088b30e165df8311c5f2176ce60e122475
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : paVhQRQvT89AudcbbU7tuCcxjNTJQBUp3vPtTFNk0tJfoA4V07ZOB0PIlgaL18Yt4RvR4TuKnQIX7DqAwAc4P0BxKBhdKXBSyXYv0PqB9PlvTHNEYsB722DcLgKORru5CY0sRkF7D0gOlOK0vYCUvZLHsfpwlIXuJAbIOzHSB516cO6vAYaA8I6LfU/L3dsFBhvBo++b5vsCFOpHFyfOOPTc15sSVE37EW2Kg/KRN+SUdZiWKl67LlOCc3yUJOKtcf5tOPifA+wxaYaD1VRBt3luWHlq7KQ5lMr+r4UOlGUezoja5jSgzv/nkDGM2Kh3zEVE5m+sbDoWP+Dn2z5L5A==
signature_date    : 2024-06-22T20:03:02.988463
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes

# -*- coding: utf-8 -*-
from setuphelpers import *


r"""
Please replace public keys in authorized_keys list before building and installing this package:

"""

##authorized_keys = ['ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCy9f0/nwkXESzkL4v4ftZ24VJYvkQ/Nt6vsLab3iSWtJXqrRsBythCcbAU6W95OGxjbTSFFtp0poqMcPuogocMR7QhjY9JGG3fcnJ7nYDCGRHD4zfG5Af/tHwvJ2ew0WTYoemvlfZIG/jZ7fsuOQSyUpJoxGAlb6/QpnfSmJjxCx0VEoppWDn8CO3VhOgzVhWx0dcne+ZcUy3Kkt3HBQN0hosRfqkVSRTvkpK4RD8TaW5PrVDe1r2Q5ab37TO+Ls4xxt16QlPubNxWeH3dHVzXdmFAItuH0DuyLyMoW1oxZ6+NrKu+pAAERxM303gejFzKDqXid5m1EOTvk4xhyqYN user@host',
##                    'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDmak4Wu23RZ6XmN94bOsqecZxuTa4RRhhQmHmTZjMB7HM57/90u/B/gB/GhsPEu1nAXL0npY56tT/MPQ8vRm2C2W9A7CzN5+z5yyL3W01YZy3kzslk77CjULjfhrcfQSL3b2sPG5jv5E5/nyC/swSytucwT/PE7aXTS9H6cHIKUdYPzIt94SHoBxWRIK7PJi9d+eLB+hmDzvbVa1ezu5a8yu2kcHi6NxxfI5iRj2rsceDTp0imC1jMoC6ZDfBvZSxL9FXTMwFdNnmTlJveBtv9nAbnAvIWlilS0VOkdj1s3GxBxeZYAcKbcsK9sJzusptk5dxGsG2Z8vInaglN6OaOQ7b7tcomzCYYwviGQ9gRX8sGsVrw39gsDIGYP2tA4bRr7ecHnlNg1b0HCchA5+QCDk4Hbz1UrnHmPA2Lg9c3WGm2qedvQdVJXuS3mlwYOqL40aXPs6890PvFJUlpiVSznF50djPnwsMxJZEf1HdTXgZD1Bh54ogZf7czyUNfkNkE69yJDbTHjpQd0cKUQnu9tVxqmBzhX31yF4VcsMeADcf2Z8wlA3n4LZnC/GwonYlq5+G93zJpFOkPhme8c2XuPuCXF795lsxyJ8SB/AlwPJAhEtm0y0s0l1l4eWqxsDxkBOgN+ivU0czrVMssHJEJb4o0FLf7iHhOW56/iMdD9w== userName']
authorized_keys = []


def install():
    # Installing the software
    install_msi_if_needed('OpenSSH-Win32-v9.1.0.0.msi')
    run_powershell(r'[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path",[System.EnvironmentVariableTarget]::Machine) + ";" + ${Env:ProgramFiles} + "\OpenSSH", [System.EnvironmentVariableTarget]::Machine)')
    run_powershell('Start-Service sshd')
    run_powershell("Set-Service -Name sshd -StartupType 'Automatic'")

    for key in authorized_keys:
        run_powershell(rf'Add-Content -Force -Path C:\ProgramData\ssh\administrators_authorized_keys -Value "{key}"')
    run_powershell(r'icacls.exe "C:\ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant "*S-1-5-32-544:F" /grant "*S-1-5-18:F"')



# -*- coding: utf-8 -*-
from setuphelpers import *
from waptutils import get_sha256
import json


def update_package():
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    api_url = "https://api.github.com/repos/PowerShell/Win32-OpenSSH/releases/latest"
    os_dict = {"windows": ".msi", "linux": ".AppImage", "darwin": ".dmg"}
    arch_dict = {"x64": "win64.exe", "x86": "win32.exe"}

    # Getting latest version information from official sources
    print("API used is: %s" % api_url)
    json_load = json.loads(wgets(api_url, proxies=proxies))
    for file in json_load['assets']:
        if 'Win32' in file['name'] and 'msi' in file['name']:
            download_url = file["browser_download_url"]
            version = json_load["tag_name"].split("-")[-1].replace("v", "")
            latest_bin = file["name"]
            break

    # Downloading latest binaries
    print("Latest %s version is: %s" % (control.name, version))
    print("Download URL is: %s" % download_url)
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies)
    else:
        print("Binary is present: %s" % latest_bin)

    # Checking version from file
    version_from_file = get_version_from_binary(latest_bin).split("-")[0]
    # if not version_from_file.startswith(version) and version_from_file != '':
    if Version(version_from_file) != Version(version) and version_from_file != "":
        print("Changing version to the version number of the binary")
        os.rename(latest_bin, latest_bin.replace(version, version_from_file))
        version = version_from_file
    else:
        print("Binary file version corresponds to online version")

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        package_updated = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.set_software_version(version)
    control.save_control_to_wapt()

    # Deleting outdated binaries
    remove_outdated_binaries(version)

    # Validating update-package-sources
    return package_updated

969532d1f5e1bd7a5c9bd32a9b445195826b222659ec82cd9ff3495950854d2b : setup.py
74254aad1b4f311789c2da81f6c58b230613c39de153a7fd009fea6f028a05c7 : update_package.py
76855b7b474ac9686b5cfb8b1da0586161bf460d0328825acf410082976368fa : OpenSSH-Win32-v9.5.0.0.msi
9420721210f5d9c50c9e35c9fdbf0a088b30e165df8311c5f2176ce60e122475 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
b84ea562e06994d6f26fe3ab8452e6bbb84070a35e27762bb715155b9cd0b619 : luti.json
97ad8c0437d397c85de7d80f802c4256bb4e26f5749bc93a8d6b7b2cf1bb07db : WAPT/control