Bagikan melalui


Mulai menggunakan OpenSSH untuk Windows

OpenSSH adalah alat konektivitas untuk masuk jarak jauh yang menggunakan protokol SSH. Ini mengenkripsi semua lalu lintas antara klien dan server untuk menghilangkan penyadapan, pembajakan koneksi, dan serangan lainnya.

Klien yang kompatibel dengan OpenSSH dapat digunakan untuk menyambungkan ke perangkat klien Windows Server dan Windows.

Important

If you downloaded the OpenSSH beta from the GitHub repo at PowerShell/Win32-OpenSSH, follow the instructions listed there, not the ones in this article. Beberapa informasi dalam repositori Win32-OpenSSH berkaitan dengan produk prarilis yang mungkin dimodifikasi secara substansial sebelum dirilis. Microsoft tidak memberikan jaminan, tersurat maupun tersirat, sehubungan dengan informasi yang diberikan di sana.

Prerequisites

Sebelum memulai, komputer Anda harus memenuhi persyaratan berikut:

  • Perangkat yang menjalankan setidaknya Windows Server 2019 atau Windows 10 (build 1809).

  • PowerShell 5.1 atau yang lebih baru.

  • Akun yang merupakan anggota grup Administrator bawaan.

Prerequisites check

Untuk memvalidasi lingkungan Anda, buka sesi PowerShell yang ditingkatkan dan lakukan hal berikut:

  • Enter winver.exe and press enter to see the version details for your Windows device.

  • Jalankan $PSVersionTable.PSVersion. Verifikasi versi utama Anda setidaknya 5, dan versi minor Anda setidaknya 1. Pelajari selengkapnya tentang menginstal PowerShell di Windows.

  • Jalankan perintah berikut. Output menunjukkan True saat Anda menjadi anggota grup Administrator bawaan.

    (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
    

Mengaktifkan OpenSSH untuk Windows Server 2025

Dimulai dengan Windows Server 2025, OpenSSH sekarang diinstal secara default. Anda juga dapat mengaktifkan atau menonaktifkan sshd layanan di Manajer Server.

Untuk mengaktifkan SSHD menggunakan Manajer Server:

  1. In Server Manager, on the navigation pane to the left, select Local Server.

  2. In the Properties window, locate Remote SSH Access.

  3. Select Disabled to enable the OpenSSH service.

Note

If you need to allow or restrict specific users or groups from using OpenSSH for remote access, add them to the OpenSSH Users user group.

Menginstal OpenSSH untuk Windows Server

Untuk menginstal komponen OpenSSH pada perangkat Windows 10:

  1. Open Settings, select System, then select Optional Features.

  2. Pindai daftar untuk melihat apakah OpenSSH sudah diinstal. Jika tidak, di bagian atas halaman, pilih Tambahkan fitur, lalu:

    • Find OpenSSH Client, then select Install

    • Find OpenSSH Server, then select Install

  3. Open the Services desktop app. (Select Start, type services.msc in the search box, and then select the Service app or press ENTER.)

  4. Di panel detail, klik dua kali OpenSSH SSH Server.

  5. On the General tab, from the Startup type drop-down menu, select Automatic and then select Ok.

  6. To start the service, select Start.

Untuk menginstal komponen OpenSSH pada perangkat Windows 11:

  1. Open Settings, select System, then select Optional Features.

  2. Pindai daftar untuk melihat apakah OpenSSH sudah diinstal. If not, at the top of the page, select View Features, then:

    • Search for OpenSSH Client, select Next, then select Install

    • Search for OpenSSH Server, select Next, then select Install

  3. Open the Services desktop app. (Select Start, type services.msc in the search box, and then select the Service app or press ENTER.)

  4. Di panel detail, klik dua kali OpenSSH SSH Server.

  5. On the General tab, from the Startup type drop-down menu, select Automatic and then select Ok.

  6. To start the service, select Start.

Untuk menginstal komponen OpenSSH pada perangkat Windows Server:

  1. Open Settings, select System, then select Optional Features (also referred to as Manage optional features).

  2. Pindai daftar untuk melihat apakah OpenSSH sudah diinstal. Jika tidak, di bagian atas halaman, pilih Tambahkan fitur, lalu:

    • Search for OpenSSH Client, then select Install

    • Search for OpenSSH Server, then select Install

  3. Open the Services desktop app. (Select Start, type services.msc in the search box, and then select the Service app or press ENTER.)

  4. Di panel detail, klik dua kali OpenSSH SSH Server.

  5. On the General tab, from the Startup type drop-down menu, select Automatic and then select Ok.

  6. To start the service, select Start.

Note

Menginstal OpenSSH Server akan membuat dan mengaktifkan aturan firewall bernama OpenSSH-Server-In-TCP. Ini memungkinkan lalu lintas SSH masuk pada port 22. Jika aturan ini tidak diaktifkan dan port ini tidak terbuka, koneksi akan ditolak atau direset.

Sambungkan ke Server OpenSSH:

Setelah diinstal, Anda dapat tersambung ke OpenSSH Server dari perangkat Windows atau Windows Server dengan klien OpenSSH terinstal. Dari perintah PowerShell, jalankan perintah berikut.

ssh domain\username@servername

Setelah tersambung, Anda mendapatkan pesan yang mirip dengan output berikut.

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.

Pada titik ini, layanan meminta kata sandi Anda. Sebagai tindakan pencegahan keamanan, karakter kata sandi Anda tidak ditampilkan saat Anda memasukkannya.

Setelah tersambung, Anda akan melihat prompt shell perintah Windows berikut:

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

Hapus instalan OpenSSH untuk Windows

Untuk menghapus instalasi OpenSSH menggunakan Pengaturan Windows:

  1. Open Settings, select System, then select Optional Features (also referred to as Manage optional features).

  2. In the list, select OpenSSH Client or OpenSSH Server.

  3. Select Uninstall.

Jika layanan sedang digunakan ketika Anda menghapus instalannya, Anda harus memulai ulang Windows.

Next steps

Sekarang setelah Anda selesai menginstal OpenSSH Server untuk Windows, berikut adalah beberapa artikel yang dapat membantu Anda mempelajari cara menggunakannya: