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:11] ilyasanetworking:cisco:vty [2026/02/02 12:44] (current) – [Konfigurasi SSH] ilyasa
Line 1: Line 1:
 {{indexmenu_n>011}} {{indexmenu_n>011}}
-==== Cisco : VTY (Virtual Teletype) - telnet,ssh ====+====== Cisco : VTY (Virtual Teletype) - telnet,ssh ====== 
  
 VTY (Virtual Teletype) adalah port atau antarmuka virtual yang digunakan untuk akses jarak jauh ke perangkat jaringan. VTY memungkinkan administrator mengelola dan mengonfigurasi perangkat Cisco melalui protokol seperti Telnet dan SSH tanpa koneksi kabel console langsung. VTY (Virtual Teletype) adalah port atau antarmuka virtual yang digunakan untuk akses jarak jauh ke perangkat jaringan. VTY memungkinkan administrator mengelola dan mengonfigurasi perangkat Cisco melalui protokol seperti Telnet dan SSH tanpa koneksi kabel console langsung.
Line 7: Line 8:
  
  
-==== Telnet ==== +===== Telnet =====
 Telnet adalah protokol yang digunakan untuk mengakses Command-Line Interface (CLI) dari perangkat jaringan secara jarak jauh. Protokol ini dikembangkan pada tahun 1969 dan merupakan salah satu metode remote access paling awal. Telnet adalah protokol yang digunakan untuk mengakses Command-Line Interface (CLI) dari perangkat jaringan secara jarak jauh. Protokol ini dikembangkan pada tahun 1969 dan merupakan salah satu metode remote access paling awal.
  
Line 15: Line 15:
 ==== Konfigurasi Telnet ==== ==== Konfigurasi Telnet ====
  
-=== 1Konfigurasi Enable Secret === +  * **Step Konfigurasi Enable Secret**
 Agar Telnet dapat digunakan untuk mengakses privileged EXEC mode, perintah ''enable secret'' harus dikonfigurasi terlebih dahulu. Agar Telnet dapat digunakan untuk mengakses privileged EXEC mode, perintah ''enable secret'' harus dikonfigurasi terlebih dahulu.
 +<code>
 +R1(config)#enable secret ccna
 +</code>
  
-<code> R1(config)# enable secret ccna </code>+  * **Step 2 : (OptionalKonfigurasi Username dan ACL** 
 +Username digunakan untuk autentikasi, sedangkan ACL digunakan untuk membatasi subnet mana yang diperbolehkan mengakses VTY line.
  
-=== 2. (Optional) Konfigurasi Username dan ACL ===+<code> 
 +R1(config)#username ilyasa secret ccna 
 +R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255 
 +</code> 
 +  * **Step 3 : Konfigurasi VTY Line** 
 +Akses Telnet/SSH dikonfigurasi pada VTY line. Secara default tersedia 5 line (0–4). 
 +<code> 
 +R1(config)#line vty 0 4 
 +</code>
  
-Username digunakan untuk autentikasi, sedangkan ACL digunakan untuk membatasi subnet mana yang diperbolehkan mengakses VTY line.+  * **Step 4 : (Optional) Konfigurasi Keamanan VTY**
  
-<code> R1(config)# username ilyasa secret ccna R1(config)# access-list 1 permit 192.168.1.0 0.0.0.255 </code>+Beberapa perintah tambahan untuk meningkatkan keamanan: 
 +  * ''login local'' → menggunakan database user lokal 
 +  * ''exec-timeout'' → memutus sesi idle 
 +  * ''access-class'' → membatasi akses berdasarkan ACL
  
-=== 3. Konfigurasi VTY Line ===+<code>  
 +SW1(config-line)#login local 
 +SW1(config-line)#exec-timeout 5 0 
 +SW1(config-line)#access-class 1 in 
 +</code>
  
-Akses Telnet/SSH dikonfigurasi pada VTY line. Secara default tersedia 5 line (0–4).+  * **Step 5 : Konfigurasi Transport Input** 
 +Perintah ''transport input'' digunakan untuk menentukan protokol yang diizinkan pada VTY line. 
 +  * ''transport input telnet'' → hanya Telnet 
 +  * ''transport input ssh'' → hanya SSH 
 +  * ''transport input telnet ssh'' → Telnet dan SSH 
 +  * ''transport input all'' → semua protokol 
 +  * ''transport input none'' → tidak ada koneksi 
 +<code> 
 +SW1(config-line)#transport input telnet 
 +</code>
  
-<code> R1(config)# line vty 0 4 </code>+=== Full Konfigurasi Telnet ====
  
-=== 4(Optional) Konfigurasi Keamanan VTY ====+<code> 
 +username ilyasa secret ccna 
 +access-list 1 permit 192.168.122.0 0.0.0.255
  
-Beberapa perintah tambahan untuk meningkatkan keamanan:+line vty 0 4 
 + access-class 1 in 
 + exec-timeout 5 0 
 + login local 
 + transport input telnet 
 +</code>
  
-''login local'' → menggunakan database user lokal+=== Hasil Test Telnet ====
  
-''exec-timeout'' → memutus sesi idle+<code> 
 +ilyasa@lept0p:~$ telnet 192.168.122.19 
 +Trying 192.168.122.19... 
 +Connected to 192.168.122.19. 
 +Escape character is '^]'.
  
-''access-class'' → membatasi akses berdasarkan ACL+User Access Verification
  
-<codeSW1(config-line)# login local SW1(config-line)# exec-timeout 5 0 SW1(config-line)# access-class 1 in </code>+Username: ilyasa 
 +Password: 
 +R1> 
 +</code>
  
-=== 5. Konfigurasi Transport Input ==== 
  
-Perintah ''transport input'' digunakan untuk menentukan protokol yang diizinkan pada VTY line.+===== 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
  
-''transport input telnet'' → hanya Telnet+==== Konfigurasi SSH ====
  
-''transport input ssh'' → hanya SSH 
  
-''transport input telnet ssh'' → Telnet dan 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
  
-''transport input all'' → semua protokol+Image IOS yang mendukung SSH akan memiliki 'K9pada 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>
  
-''transport input none'' → tidak ada koneksi+----
  
-<code> SW1(config-line)# transport input telnet </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>
  
-=== Full Konfigurasi Telnet ====+----
  
-<code> username ilyasa secret ccna access-list 1 permit 192.168.122.0 0.0.0.255+  * **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 line vty 0 4
-access-class 1 in + access-class 1 in 
-exec-timeout 5 0 + exec-timeout 5 0 
-login local + login local 
-transport input telnet+ transport input ssh
 </code> </code>
  
-=== Hasil Test Telnet ====+=== Hasil Test SSH ====
  
-<codeilyasa@lept0p:~$ telnet 192.168.122.19 Trying 192.168.122.19... Connected to 192.168.122.19. Escape character is '^]'.+<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 keyDengan 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>
  
-User Access Verification 
  
-Username: ilyasa +<code> 
-Password:+ilyasa@lept0p:~$ ssh -o HostKeyAlgorithms=+ssh-rsa ilyasa@192.168.122.19 
 + 
 +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> R1>
 </code> </code>
  • networking/cisco/vty.1770009092.txt.gz
  • Last modified: 2026/02/02 12:11
  • by ilyasa