Postingan

Bagaimana cara login ssh tanpa password di windows ? pakai ssh-copy-id tidak bekerja!

Windows 10 sudah terdapat SSH tanpa kita harus menginstall Putty atau mendapatkannya melalui WSL.



PS C:\Users\Hype GLK> ssh -V

OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

Di Linux atau MacOS pada umumnya kita akan menggunakan perintah berikut:

PS C:\Users\Hype GLK> ssh-copy-id dev@192.168.88.253

the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:1

+ ssh-copy-id dev@192.168.88.253

+ ~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (ssh-copy-id:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

namun lihat ? Windows tidak mengenali perintah tersebut

secara dasar program ssh-copy-id bekerja dengan cara
  • generate public key di komputer host (yang digunakan untuk bekerja/remote)
  • copy public key dari komputer host kedalam komputer server (yang akan di remote)
untuk generate public key dapat anda lakukan dengan perintah:
PS C:\Users\Hype GLK> ssh-keygen
Generating public/private ed25519 key pair.
Enter file in which to save the key (C:\Users\Hype GLK/.ssh/id_ed25519):

perintah cat (type: di Windows) untuk menampilkan konten file:

type $env:USERPROFILE\.ssh\id_rsa.pub
kombinasikan dengan buffer dari output perintah type atau cat kemudian jadikan input untuk perintah cat dengan menggunakan pipeline dan tambahkan kedalam .ssh/authorized_keys di ssh server anda
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh {IP-ADDRESS-OR-FQDN} "cat >> .ssh/authorized_keys"
  • ganti IP-ADDRESS-OR-FQDN menjadi user@ip-remote milik anda
debug hati

Posting Komentar

NextGen Digital Welcome to WhatsApp chat
Howdy! How can we help you today?
Type here...