• Главная
  • Вокруг света. Путешествия
  • Мастерская
    • Программирование
    • Интернет-мастерская
    • Литературная
    • Электроника
  • Заметки

OpenSSH на WindowsServer2019

To install OpenSSH using PowerShell:

  1. Run PowerShell as an Administrator.

  2. Run the following cmdlet to make sure that OpenSSH is available:

    PowerShell
     
    Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
    

    The command should return the following output if neither are already installed:

    PowerShell
     
    Name  : OpenSSH.Client~~~~0.0.1.0
    State : NotPresent
    
    Name  : OpenSSH.Server~~~~0.0.1.0
    State : NotPresent
    
  3. After that, run the following cmdlets to install the server or client components as needed:

    PowerShell
     
    # Install the OpenSSH Client
    Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
    
    # Install the OpenSSH Server
    Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
    

    Both commands should return the following output:

    PowerShell
     
    Path          :
    Online        : True
    RestartNeeded : False
    
  4. To start and configure OpenSSH Server for initial use, open an elevated PowerShell prompt (right-click, then select Run as an administrator), then run the following commands to start the sshd service:

    PowerShell
     
    # Start the sshd service
    Start-Service sshd
    
    # OPTIONAL but recommended:
    Set-Service -Name sshd -StartupType 'Automatic'
    
    # Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify
    if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
        Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
        New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
    } else {
        Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
    }
    

Connect to OpenSSH Server

Once installed, you can connect to OpenSSH Server from a Windows or Windows Server device with the OpenSSH client installed. From a PowerShell prompt, run the following command.

PowerShell
 
ssh domain\username@servername

Once connected, you get a message similar to the following output.

PowerShell
 
The authenticity of host 'servername (10.00.00.001)' can't be established.
ECDSA key fingerprint is SHA256:(<a large string>).
Are you sure you want to continue connecting (yes/no)?

Entering yes adds that server to the list of known SSH hosts on your Windows client.

At this point, the service prompts you for your password. As a security precaution, the characters of your password aren't displayed as you enter them.

Once connected, you should see the following Windows command shell prompt:

PowerShell
 
domain\username@SERVERNAME C:\Users\username>

Uninstall OpenSSH for Windows

  • GUI
  • PowerShell

To uninstall the OpenSSH components using PowerShell, use the following commands:

PowerShell
 
# Uninstall the OpenSSH Client
Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

# Uninstall the OpenSSH Server
Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

If the service was in use when you uninstalled it, you should restart Windows.

Подробности
Категория: Заметки
Опубликовано: 19 мая 2025

Автозапуск в raspbian

Еще один способ автозапуска приложения - через ярлык. Сегодня нашел, не знал такого.

Создать, если нет такой,  папку .config/autostart  в /home (или /home/user вероятно для конкретного пользователя)

Туда скопировать нужный ярлык. Все заготовки ярлыков для всех установленных программ можно взять здесь /usr/share/applications

Ну далее просто отредактировать в свойствах строку автозапуска или в текстовом редакторе строчку командной строки добавив нужные параметры например --kiosk http://google.ru

 

Подробности
Категория: Заметки
Опубликовано: 14 января 2025
  • raspbian
  • автостарт
  • режим киоска

Raspberry Pi + LCD 2.8/3.5 экранчик

Установка драйверов

 

git clone https://github.com/waveshare/LCD-show.git
cd LCD-show/

chmod +x LCD35-show sudo ./LCD35-show или нужную версию драйвера

#X 0, 90, 180, and 270. Поворот экрана sudo ./LCD28-show X


Подробности
Категория: Заметки
Опубликовано: 27 декабря 2024

Если перестал открываться Chromium на Raspbian OS

В папке пользователя ~/.config/chromium/  удалить файлы 'SingletonCookie', 'SingletonLock' и SingletonSocket . Браузер откроется без потери настроек.

Подробности
Категория: Заметки
Опубликовано: 25 декабря 2024

Подкатегории

Страница 1 из 11

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

Персональный сайт, блог, резюме Алексея Зиневича