networking:cisco:vty

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
networking:cisco:vty [2026/02/02 12:24] – [Konfigurasi Telnet] ilyasanetworking:cisco:vty [2026/02/02 12:44] (current) – [Konfigurasi SSH] ilyasa
Line 61: Line 61:
  
 <code> <code>
 +username ilyasa secret ccna
 +access-list 1 permit 192.168.122.0 0.0.0.255
 +
 +line vty 0 4
 + access-class 1 in
 + exec-timeout 5 0
 + login local
 + transport input telnet
 </code> </code>
  
Line 66: Line 74:
  
 <code> <code>
 +ilyasa@lept0p:~$ telnet 192.168.122.19
 +Trying 192.168.122.19...
 +Connected to 192.168.122.19.
 +Escape character is '^]'.
 +
 +User Access Verification
 +
 +Username: ilyasa
 +Password:
 +R1>
 +</code>
 +
 +
 +===== SSH =====
 +SSH, atau Secure Shell, dikembangkan pada tahun 1995 untuk menggantikan protokol yang kurang aman seperti Telnet.
 +SSH menyediakan fitur keamanan seperti enkripsi dan autentikasi data, yang akan dibahas lebih lanjut di bagian keamanan dalam kursus ini. .
 +Paket SSH dienkripsi, dan hanya server dan klien SSH yang memiliki kunci untuk mendekripsi, sehingga menyulitkan orang lain untuk mengakses isinya
 +
 +==== Konfigurasi SSH ====
 +
 +
 +  * **Step 1 – Verifikasi IOS Mendukung SSH**
 +  
 +Untuk mengonfigurasi SSH, kunci RSA harus dibuat, yang digunakan untuk enkripsi, dekripsi, dan autentikasi data, dan ini dapat dilakukan setelah memastikan image iOS mendukung SSH
 +
 +Image IOS yang mendukung SSH akan memiliki 'K9' pada namanya.
 +contoh :
 +<code>
 +R1#show version
 +Cisco IOS Software, IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.9(3)M6, RELEASE SOFTWARE (fc1)
 +Technical Support: http://www.cisco.com/techsupport
 +Copyright (c) 1986-2022 by Cisco Systems, Inc.
 +Compiled Mon 08-Aug-22 15:22 by mcpre
 +...
 +</code>
 +
 +----
 +
 +  * **Step 2 – Konfigurasi Domain Name**
 +  
 +Domain name diperlukan untuk membentuk **FQDN (Fully Qualified Domain Name)** yang akan digunakan sebagai nama RSA key.
 +<code>
 +R1(config)#ip domain name labyas.my.id
 +</code>
 +
 +----
 +
 +  * **Step 3 – Generate RSA Key**
 +  
 +RSA key digunakan untuk enkripsi, dekripsi, dan autentikasi SSH.
 +
 +<code>
 +R1(config)#crypto key generate rsa
 +</code>
 +
 +IOS akan menampilkan nama key berdasarkan FQDN perangkat:
 +
 +<code>
 +R1(config)#crypto key generate rsa
 +The name for the keys will be: R1.labyas.my.id
 +Choose the size of the key modulus in the range of 360 to 4096 for your
 +  General Purpose Keys. Choosing a key modulus greater than 512 may take
 +  a few minutes.
 +</code>
 +
 +----
 +
 +  * **Step 4 – Menentukan Panjang RSA Key**
 +  
 +Semakin besar ukuran key, semakin aman, tetapi waktu generate lebih lama.  
 +Untuk **SSHv2**, ukuran key **minimal 768 bit**, direkomendasikan **2048 bit**.
 +
 +<code>
 +How many bits in the modulus [512]: 2048
 +% Generating 2048 bit RSA keys, keys will be non-exportable...
 +[OK] (elapsed time was 1 seconds)
 +</code>
 +
 +----
 +
 +  * **Step 5 – Verifikasi SSH Aktif**
 +  
 +Setelah RSA key dibuat, IOS akan menampilkan pesan Syslog bahwa SSH telah aktif.
 +
 +<code>
 +R1(config)#
 +*Dec 22 10:28:29.531: %SSH-5-ENABLED: SSH 1.99 has been enabled
 +</code>
 +
 +Verifikasi status SSH dengan perintah berikut:
 +
 +<code>
 +R1#show ip ssh
 +SSH Enabled - version 1.99
 +Authentication methods:publickey,keyboard-interactive,password
 +Authentication Publickey Algorithms:x509v3-ssh-rsa,ssh-rsa
 +Hostkey Algorithms:x509v3-ssh-rsa,ssh-rsa
 +Encryption Algorithms:aes128-ctr,aes192-ctr,aes256-ctr
 +MAC Algorithms:hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-sha1-96
 +KEX Algorithms:diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
 +Authentication timeout: 120 secs; Authentication retries: 3
 +Minimum expected Diffie Hellman key size : 2048 bits
 +IOS Keys in SECSH format(ssh-rsa, base64 encoded): R1.labyas.my.id
 +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHjXiLjNODKOGzDSqds1fCkioEwYxDFAt5u35Rxd2O
 +BcSJNnjIM2Z3OjZjORP3P+X/iz2E1szTe2/NkH/1+6zNEjMa52t7YyhTldVGceaPidgPEzO3GltMnUSJ
 +591NNObxMWWOzkO2w75p6MJqOXTem2pT0PedVS6Qe6m6KdLvEGfSw/C9DwcDMl4j9dU/DJtlI3F+lOsH
 +WVMk/gK52cWjW37VV+m7TCPI02zaCloOgCwy9TJdwF6gKWBk6sNVcTWVn84O3M5LJ7/BQlevr0lbFufY
 +Im/iIkc9OzN+zvGxs9DHrtCU24p/uspl1EMqpZ4fyFkqzrrpdtQwrSQA+5Ql
 +</code>
 +
 +----
 +
 +  * **Step 6 – Konfigurasi VTY**
 +Sekarang hanya perlu mengaktifkan ssh pada ''vty line 0 5'' , sama dengan konfigurasi telnet dengan ''transport input ssh''
 +
 +<code>
 +username ilyasa secret ccna
 +access-list 1 permit 192.168.122.0 0.0.0.255
 +
 +line vty 0 4
 + access-class 1 in
 + exec-timeout 5 0
 + login local
 + transport input ssh
 +</code>
 +
 +=== Hasil Test SSH ====
 +
 +<WRAP center round info 90%>
 +Opsi ''-o HostKeyAlgorithms=+ssh-rsa'' digunakan karena klien SSH modern secara default menonaktifkan algoritma ''ssh-rsa'' yang berbasis SHA-1 dan dianggap tidak aman, sementara banyak perangkat Cisco IOS lama masih menggunakan algoritma tersebut sebagai host key. Dengan menambahkan opsi ini, klien SSH dipaksa untuk mengizinkan kembali ''ssh-rsa'' agar koneksi ke perangkat Cisco lama tetap dapat dilakukan, dan sebaiknya hanya digunakan untuk lab atau pembelajaran.
 +</WRAP>
 +
 +
 +<code>
 +ilyasa@lept0p:~$ ssh -o HostKeyAlgorithms=+ssh-rsa [email protected]
 +
 +The authenticity of host '192.168.122.19 (192.168.122.19)' can't be established.
 +RSA key fingerprint is SHA256:umrNu6vY+tTho9GDL4/jyZLiZH+eqCnrMxCrflty0Ro.
 +This key is not known by any other names.
 +Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
 +Warning: Permanently added '192.168.122.19' (RSA) to the list of known hosts.
 +
 +**************************************************************************
 +* IOSv is strictly limited to use for evaluation, demonstration and IOS  *
 +* education. IOSv is provided as-is and is not supported by Cisco'     *
 +* Technical Advisory Center. Any use or disclosure, in whole or in part, *
 +* of the IOSv Software or Documentation to any third party for any       *
 +* purposes is expressly prohibited except as otherwise authorized by     *
 +* Cisco in writing.                                                      *
 +********************************* ****************************************
 +([email protected]) Password:
 +
 +
  
 +**************************************************************************
 +* IOSv is strictly limited to use for evaluation, demonstration and IOS  *
 +* education. IOSv is provided as-is and is not supported by Cisco'     *
 +* Technical Advisory Center. Any use or disclosure, in whole or in part, *
 +* of the IOSv Software or Documentation to any third party for any       *
 +* purposes is expressly prohibited except as otherwise authorized by     *
 +* Cisco in writing.                                                      *
 +**************************************************************************
 +R1>
 </code> </code>
  • networking/cisco/vty.1770009850.txt.gz
  • Last modified: 2026/02/02 12:24
  • by ilyasa