Chapterبەش 1 · Lectureوانە 1.5

Managing Devices Remotely: From Telnet to SSHبەڕێوەبردنی ئامێرەکان لە دوورەوە: لە Telnetـەوە بۆ SSH

Reach switches and routers from your desk instead of the console: give a switch a management SVI and default gateway, understand vty lines, see in one Telnet lab why plain-text logins are dangerous, then set up SSH step by step — host name, domain name, a 2048-bit RSA key, SSH version 2, a local user with a secret and SSH-only vty lines — connect from a PC, check the host key and verify with show ip ssh and show ssh.

لەبری کۆنسۆڵ لە مێزەکەتەوە بگە بە و : SVIـی بەڕێوەبردن و بدە بە ، تێبگە، لە یەک تاقیکردنەوەی ببینە بۆچی بە مەترسیدارە، پاشان هەنگاو بە هەنگاو ڕێک بخە — ، ، ⁦2048⁩ ، وەشانی 2ـی ، ناوخۆیی بە نهێنییەوە و تەنیا — لە PCـێکەوە پەیوەندی بکە، ئامێرەکە بپشکنە و بە show ip ssh و show ssh بیپشکنە.

16 min read17 خولەک خوێندنەوە · 17 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Give a layer 2 switch a management address on an SVI and a default gateway.
  • Explain vty lines and secure all of them.
  • Explain why Telnet is unsafe on every network by what an eavesdropper sees.
  • Configure SSH version 2 with a 2048-bit RSA key, a local user with a secret and SSH-only vty lines, and save it.
  • Connect with an SSH client, judge the host-key alert and verify with show ip ssh and show ssh.
  • ناونیشانی بەڕێوەبردن لەسەر SVI و بدەیت بە چینی 2.
  • ڕوون بکەیتەوە و هەموویان بپارێزیت.
  • بەو شتەی گوێگر دەیبینێت ڕوونی بکەیتەوە بۆچی لەسەر هەموو مەترسیدارە.
  • وەشانی 2 بە ⁦2048⁩ ، ناوخۆیی بە نهێنییەوە و تەنیا ڕێک بخەیت و پاشەکەوتی بکەیت.
  • بە کلاینتێکی پەیوەندی بکەیت، ئاگاداریی هەڵبسەنگێنیت و بە show ip ssh و show ssh بیپشکنیت.

Why manage devices remotely?بۆچی ئامێرەکان لە دوورەوە بەڕێوە دەبرێن؟

A college network has switches in every building and routers in locked rooms. With a console cable you must walk to each one and plug in. Remote management lets you open the command line of any device from your own desk, over the same network that carries the users’ data.

کۆلێژێک لە هەموو بینایەکدا و لە ژووری داخراودا هەیە. بە دەبێت بۆ لای هەریەکەیان بڕۆیت و کێبڵەکە ببەستیت. بەڕێوەبردن لە دوورەوە ڕێگەت پێ دەدات هێڵی هەر ئامێرێک لە مێزی خۆتەوە بکەیتەوە، لە ڕێگەی هەمان کە هەڵدەگرێت.

Two protocols do this job. Telnet is old and sends everything — even the password — as readable text. SSH (Secure Shell) does the same job inside an encrypted tunnel. You will build both once, so that you can see why only SSH is allowed on a real network (remote-access protocols in general).

دوو ئەم کارە دەکەن. کۆنە و هەموو شتێک — تەنانەت — وەک دەقێکی خوێندراوە دەنێرێت. ⁦(Secure Shell)⁩ هەمان کار لە ناو تونێلێکی شفرەکراودا دەکات. هەردووکیان یەک جار دروست دەکەیت، بۆ ئەوەی ببینیت بۆچی تەنیا لەسەر ڕاستەقینە ڕێگەپێدراوە (پرۆتۆکۆڵەکانی دەستڕاگەیشتن لە دوورەوە بە گشتی).

Two ways to reach the command line. Left, console: a person with a laptop stands next to a rack of three switches, joined by a blue console cable — out-of-band, needs no IP, but you must be in the room. Right, remote: a person at a desk PC reaches switches SW1, SW2 and SW3 in different buildings through the network — SSH to any building, needs an IP and a secure login.دوو ڕێگە بۆ گەیشتن بە هێڵی فەرمان. لای چەپ، کۆنسۆڵ: کەسێک بە لاپتۆپێکەوە لە تەنیشت ڕەفێکی سێ سویچەوە وەستاوە، بە کێبڵی کۆنسۆڵێکی شینەوە — پێویستی بە IP نییە، بەڵام دەبێت لە ژوورەکەدا بیت. لای ڕاست، لە دوورەوە: کەسێک لە سەر مێزەکەی بە PCـێکەوە لە ڕێگەی ڕایەڵەوە دەگاتە SW1، SW2 و SW3 لە بینای جیاواز — SSH بۆ هەر بینایەک، IP و چوونەژوورەوەی پارێزراوی پێویستە.
Console for the first set-up and emergencies; SSH for everyday work.کۆنسۆڵ بۆ ڕێکخستنی یەکەم جار و کاتی ناچاری؛ بۆ کاری ڕۆژانە.CêIT

A switch needs an address to be reachedسویچ بۆ ئەوەی پێی بگەیت ناونیشانێکی پێویستە

To reach a device over the network you need its IP address. A router already has addresses on its interfaces. A layer 2 switch is different: its ports only pass frames along, and they take no IP address. So the switch gets one virtual interface for management — a switch virtual interface (SVI) in VLAN 1, the VLAN that every port belongs to at the start.

بۆ گەیشتن بە ئامێرێک لە ڕێگەی پێویستە. پێشتر لەسەر ناونیشانی هەیە. چینی 2 جیاوازە: تەنیا دەگوازنەوە و هیچ وەرناگرن. بۆیە یەک گریمانەیی بۆ بەڕێوەبردن وەردەگرێت — لە ⁦VLAN 1⁩، ئەو لە سەرەتادا هەموو سەر بەوە.

Definitionپێناسە

A virtual interface of a switch for one VLAN (interface vlan 10). An SVI gives a layer 2 switch an IP address for remote management; on a layer 3 switch it is the default gateway of the VLAN.

گریمانەیی بۆ یەک VLAN (interface vlan 10). SVI ناونیشانێکی IP دەدات بە سویچێکی چینی 2 بۆ بەڕێوەبردنی لە دوورەوە؛ لەسەر VLANـەکەیە.

A layer 2 Catalyst 2960 switch SW1 with twelve ports Fa0/1 to Fa0/12 along the bottom. Inside the switch, a dashed box “interface vlan 1, 192.168.1.10 /24” is joined by thin lines to every port. Text: ports carry frames but take no IP address (layer 2); the SVI is the one IP of the whole switch, reachable through any VLAN 1 port.سویچی چینی 2ـی Catalyst 2960 بە ناوی SW1 بە دوازدە دەرچە لە Fa0/1 تا Fa0/12 لە خوارەوە. لە ناو سویچەکەدا خانەیەکی پچڕپچڕ «interface vlan 1، 192.168.1.10/24» بە هێڵی باریک بە هەموو دەرچەیەکەوە بەستراوە. دەق: دەرچەکان فرەیم دەگوازنەوە بەڵام IP وەرناگرن (چینی 2)؛ SVI تاکە IPـی هەموو سویچەکەیە و لە هەر دەرچەیەکی VLAN 1ـەوە دەگەیەنرێت.
One management address for the whole switch.یەک ناونیشانی بەڕێوەبردن بۆ هەموو .CêIT

Give the switch its management addressناونیشانی بەڕێوەبردن بدە بە سویچەکە

Name the switch first — a network has many switches, and the host name tells you which one you are typing into. Then configure the SVI exactly like a router interface and add a default gateway, so that the switch can answer administrators in other networks too.

سەرەتا ناو لە بنێ — چەندین هەیە و پێت دەڵێت لە ناو کامیاندا دەنووسیت. پاشان SVIـەکە ڕێک وەک ڕێک بخە و زیاد بکە، بۆ ئەوەی بتوانێت وەڵامی بەڕێوەبەرانی تریش بداتەوە.

The management SVI (Packet Tracer output)SVIـی بەڕێوەبردن (دەرچوونی Packet Tracer)TEXT
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SW1
SW1(config)#interface vlan 1
SW1(config-if)#ip address 192.168.1.10 255.255.255.0
SW1(config-if)#no shutdown

SW1(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
SW1(config-if)#exit
SW1(config)#ip default-gateway 192.168.1.1
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 7

An SVI starts shut down, like a router interface. It comes up only while at least one port of its VLAN is up (a PC is connected).

SVI بە کوژاوەیی دەست پێ دەکات، وەک . تەنیا کاتێک up دەبێت کە لانیکەم یەک up بێت (PCـێک بەستراوە).

Lineدێڕی 14

Typed in global configuration, not inside the SVI. A layer 2 switch uses it like a PC uses its gateway.

لە دەنووسرێت، نەک لە ناو SVIـەکەدا. چینی 2 وەک PC کە بەکار دەهێنێت، بەکاری دەهێنێت.

An admin PC at 192.168.2.50 in network 192.168.2.0/24 reaches router R1 (.2.1 and .1.1), and through it switch SW1 with SVI 192.168.1.10 in network 192.168.1.0/24. A curved arrow from SW1 back to R1: reply to 192.168.2.50 — send it to 192.168.1.1. Below: SW1(config)#ip default-gateway 192.168.1.1. Without it, SW1 can answer only PCs in its own network 192.168.1.0/24.PCـی بەڕێوەبەر بە 192.168.2.50 لە ڕایەڵەی 192.168.2.0/24 دەگاتە ڕێدۆزی R1 (192.168.2.1 و 192.168.1.1) و لە ڕێگەیەوە بە سویچی SW1 بە SVIـی 192.168.1.10 لە ڕایەڵەی 192.168.1.0/24. تیرێکی چەماوە لە SW1ـەوە بۆ R1: وەڵام بۆ 192.168.2.50 ← بینێرە بۆ 192.168.1.1. لە خوارەوە: SW1(config)#ip default-gateway 192.168.1.1. بەبێ ئەمە، SW1 تەنیا وەڵامی PCـەکانی ڕایەڵەی خۆی (192.168.1.0/24) دەداتەوە.
The switch’s default gateway is for its own replies only. تەنیا بۆ وەڵامەکانی خۆیەتی.CêIT

vty lines: the doors for remote sessionsهێڵەکانی VTY: دەرگاکانی دانیشتنی دوور

A console session comes in through the console line. Remote sessions — Telnet or SSH — come in through virtual terminal (vty) lines. Each line is one session, so the number of lines is the number of administrators who can be logged in at the same time. You secure them all at once with line vty 0 15 (lines 0 to 15).

دانیشتنێکی کۆنسۆڵ لە ڕێگەی هێڵی کۆنسۆڵەوە دێت. دانیشتنە دوورەکان — یان — لە ڕێگەی دێن. هەر هێڵێک یەک دانیشتنە، بۆیە ژمارەی هێڵەکان ژمارەی ئەو بەڕێوەبەرانەیە کە دەتوانن لە یەک کاتدا چوونە ژوورەوە. هەموویان بە یەکجار بە line vty 0 15 (هێڵی 0 تا ⁦15⁩) دەپارێزیت.

Definitionپێناسە

Virtual teletype lines: the virtual 'doors' of a Cisco device for remote command-line sessions over Telnet or SSH (line vty 0 15). They should allow SSH only, with login local.

هێڵەکانی ⁦Virtual Teletype: '⁩دەرگا' گریمانەییەکانی ئامێرێکی Ciscoـن بۆ دانیشتنی هێڵی فەرمان لە دوورەوە بە یان (line vty 0 15). دەبێت تەنیا ڕێگە بە SSH بدەن، لەگەڵ login local.

Sixteen small doors numbered 0 to 15. Doors 0 to 4 are green with a bracket: vty 0–4, five lines, often all a router shows. All sixteen have a blue bracket: vty 0–15, sixteen lines on a Catalyst 2960 switch. Text: secure every line the same way — line vty 0 15 (or 0 4 where only five exist).شازدە دەرگای بچووک بە ژمارەی 0 تا 15. دەرگاکانی 0 تا 4 سەوزن بە کەوانەیەکەوە: vty 0–4، پێنج هێڵ، زۆرجار هی ڕێدۆز. هەر شازدەکەیان کەوانەیەکی شینیان هەیە: vty 0–15، شازدە هێڵ لەسەر سویچی Catalyst 2960. دەق: هەموو هێڵەکان بە یەک شێوە بپارێزە — line vty 0 15 (یان 0 4 کە تەنیا پێنج هەبن).
A line you forget is an open door.هێڵێک لەبیرت بچێت دەرگایەکی کراوەیە.CêIT

The Telnet lab — once, to see the dangerتاقیکردنەوەی Telnet — تەنیا یەک جار، بۆ بینینی مەترسییەکە

Cable PC1 to SW1 with a straight-through cable and wait until both link lights are green. Give PC1 192.168.1.20/24. Then open the vty lines with a line password and login (“ask for that password”), and set an enable secret — without it a remote user can never reach privileged EXEC.

⁦PC1⁩ بە بە ⁦SW1⁩ـەوە ببەستە و چاوەڕێ بکە تا هەردوو سەوز دەبن. ⁦192.168.1.20/24⁩ بدە بە ⁦PC1⁩. پاشان بە هێڵ و login («داوای ئەو بکە») بکەرەوە و enable secret دابنێ — بەبێ ئەوە دوور هەرگیز ناگاتە .

The lab: PC1 joined to SW1 by a copper straight-through cable, Fa0 to Fa0/1. PC1’s settings: IPv4 Address 192.168.1.20, Subnet Mask 255.255.255.0, Default Gateway 192.168.1.1. SW1: interface vlan 1, ip address 192.168.1.10 255.255.255.0, no shutdown.تاقیکردنەوەکە: PC1 بە کێبڵی ڕاستەوخۆ بە SW1ـەوە بەستراوە، Fa0 بۆ Fa0/1. ڕێکخستنی PC1: IPv4 Address 192.168.1.20، Subnet Mask 255.255.255.0، Default Gateway 192.168.1.1. SW1: interface vlan 1، ip address 192.168.1.10 255.255.255.0، no shutdown.
One PC, one switch: enough to try Telnet and then SSH.یەک PC، یەک : بەسە بۆ تاقیکردنەوەی و پاشان .CêIT
Switch side (lab only)لای سویچ (تەنیا بۆ تاقیکردنەوە)TEXT
SW1(config)#line vty 0 15
SW1(config-line)#password vtyPass
SW1(config-line)#login
SW1(config-line)#exit
SW1(config)#enable secret En@ble2026
PC1: Desktop > Command Prompt (passwords are not shown while you type)⁦PC1: Desktop > Command Prompt⁩ (تێپەڕەوشەکان لە کاتی نووسیندا دەرناکەون)TEXT
C:\>telnet 192.168.1.10
Trying 192.168.1.10 ...Open


User Access Verification

Password:
SW1>enable
Password:
SW1#

If no enable secret is set, enable over Telnet answers % No password set and you stay in user EXEC.

ئەگەر enable secret دانەنرابێت، enable لە ڕێگەی وەڵام دەداتەوە % No password set و لە دەمێنیتەوە.

What an eavesdropper seesئەوەی هێرشبەرێکی گوێگر دەیبینێت

Telnet worked — and that is the problem. Telnet (TCP port 23) sends every key you press as a plain character. Anyone who can capture traffic on the path — a classmate with a packet-capture program, an infected PC, a switch port mirrored by mistake — reads your password and every command.

کاری کرد — و ئەوە کێشەکەیە. ( ⁦23⁩ی TCP) هەر دابگریت وەک پیتێکی ئاشکرا دەنێرێت. هەر کەسێک بتوانێت هاتوچۆ لەسەر ڕێگەکە بگرێت — هاوپۆلێک بە گرتنی ، PCـێکی تووشبوو، کە بە هەڵە کۆپی دەکرێت — و هەموو دەخوێنێتەوە.

Animation in four frames. 1, Telnet on TCP port 23: the switch’s prompt “Password:” crosses the cable as readable letters (P, a, s, s, w, o, r), and a laptop with a magnifying glass below the cable captures them. 2: the keys typed on PC1 cross the same way — v, t, y, P, a, s, s — and the capture shows “Password: vtyPass”: the eavesdropper now has your password. 3 and 4, SSH on TCP port 22: the boxes carry bytes such as 8f c1 3a e7; the capture shows only meaningless bytes. Last frame: use SSH, never Telnet — on every network.
Animation in four frames. 1, Telnet on TCP port 23: the switch’s prompt “Password:” crosses the cable as readable letters (P, a, s, s, w, o, r), and a laptop with a magnifying glass below the cable captures them. 2: the keys typed on PC1 cross the same way — v, t, y, P, a, s, s — and the capture shows “Password: vtyPass”: the eavesdropper now has your password. 3 and 4, SSH on TCP port 22: the boxes carry bytes such as 8f c1 3a e7; the capture shows only meaningless bytes. Last frame: use SSH, never Telnet — on every network.
The same login over Telnet and over SSH, seen from the wire.هەمان بە و بە ، لە سەر وایەرەکەوە.CêIT

What SSH addsئەوەی SSH زیادی دەکات

SSH (TCP port 22) protects three things at once. It encrypts the whole session. The device proves who it is with its host key, so you know you reached the real switch and not an impostor. And you prove who you are with a username and secret. The device’s key is an RSA key pair: a public key it shows to everyone and a private key it never gives away (how key pairs work).

( ⁦22⁩ی TCP) سێ شت پێکەوە دەپارێزێت. هەموو دانیشتنەکە شفرە دەکات. ئامێرەکە بە خۆی دەیسەلمێنێت کێیە، بۆیە دەزانیت گەیشتوویت بە ڕاستەقینەکە نەک بە ساختەیەک. و تۆ دەیسەلمێنیت کێیت بە و نهێنییەک. ئامێرەکە ـە: کە بە هەمووانی پیشان دەدات و کە هەرگیز نایداتە کەس (جووتە کلیل چۆن کار دەکات).

Three cards. 1 Encryption — nobody on the path can read your commands or password. 2 The device proves itself — its host key shows you reached the real switch, not a fake. 3 You prove yourself — a username and a hashed secret from the local user list. Below: all three ride on one TCP connection to port 22.سێ کارت. 1 شفرەکردن — کەس لە ڕێگەدا ناتوانێت فەرمانەکان و تێپەڕەوشەکەت بخوێنێتەوە. 2 ئامێرەکە خۆی دەسەلمێنێت — کلیلی میوانگری ئامێرەکە دەری دەخات گەیشتوویت بە سویچە ڕاستەقینەکە. 3 تۆ خۆت دەسەلمێنیت — ناوی بەکارهێنەر و نهێنییەکی هاشکراو لە لیستی بەکارهێنەرانی ناوخۆیی. لە خوارەوە: هەر سێکیان لەسەر یەک پەیوەندیی TCP بۆ پۆرتی 22 کار دەکەن.
Encryption, server authentication, user authentication.، ئامێر، .CêIT

Setting up SSH, step by stepڕێکخستنی SSH، هەنگاو بە هەنگاو

The seven stepsحەوت هەنگاوەکە
  1. A host nameناوی میوانگر

    hostname SW1 — the key’s name is built from the host name, and the default name “Switch” is refused.

    hostname SW1 — ناوی لە دروست دەکرێت و ناوی بنەڕەتی «Switch» ڕەت دەکرێتەوە.

  2. A domain nameناوی دۆمەین

    ip domain-name example.com — the second half of the key’s name (newer IOS XE shows it as ip domain name).

    ip domain-name example.com — نیوەی دووەمی ناوی (IOS XEـی نوێتر بە شێوەی ip domain name پیشانی دەدات).

  3. An RSA key pairجووتە کلیلێکی RSA

    crypto key generate rsa with a modulus of 2048 bits or more — this also switches SSH on.

    crypto key generate rsa بە قەبارەی ⁦2048⁩ یان زیاتر — ئەمە هەڵدەکات.

  4. Version 2 onlyتەنیا وەشانی 2

    ip ssh version 2 — refuse the old version.

    ip ssh version 2 — وەشانە کۆنەکە ڕەت بکەرەوە.

  5. A local userبەکارهێنەرێکی ناوخۆیی

    username admin secret … — a local user whose password is stored hashed.

    username admin secret … — ناوخۆیی کە بە هاشکراوی هەڵدەگیرێت.

  6. Lock the vty linesهێڵەکانی VTY قفڵ بکە

    line vty 0 15 + login local + transport input ssh — check the local user, accept SSH only.

    line vty 0 15 + login local + transport input ssh — ناوخۆیی بپشکنە، تەنیا وەربگرە.

  7. Reachable and savedگەیشتنی پێی و پاشەکەوت

    An address to reach (the SVI from before), an enable secret, and copy running-config startup-config.

    ناونیشانێک بۆ گەیشتن (SVIـەکەی پێشوو)، enable secret و copy running-config startup-config.

A checklist card: SSH on a Cisco switch or router. A name — hostname SW1. A domain name — ip domain-name example.com. A key pair of 2048 bits or more — crypto key generate rsa (highlighted). Version 2 only — ip ssh version 2. A local user with a secret — username admin secret …. vty lines check that user — line vty 0 15 + login local. vty lines accept SSH only — transport input ssh. An address to reach (SVI) and save — interface vlan 1 … / copy run start.کارتی لیستی پشکنین: SSH لەسەر سویچ یان ڕێدۆزێکی Cisco. ناو — hostname SW1. ناوێکی دۆمەین — ip domain-name example.com. جووتە کلیلێک بە 2048 بیت یان زیاتر — crypto key generate rsa (ڕەنگکراو). تەنیا وەشانی 2 — ip ssh version 2. هەژمارێکی بەکارهێنەر بە نهێنییەکەوە — username admin secret …. هێڵەکانی VTY ئەو بەکارهێنەرە دەپشکنن — line vty 0 15 + login local. هێڵەکانی VTY تەنیا SSH وەردەگرن — transport input ssh. ناونیشانێک بۆ گەیشتن (SVI) و پاشەکەوت — interface vlan 1 … / copy run start.
Print it and tick it off at every new device.چاپی بکە و لە هەموو ئامێرێکی نوێدا نیشانەی لێ بدە.CêIT

Generating the key pairدروستکردنی جووتە کلیلەکە

crypto key generate rsa asks how long the key should be. The default answer, 512 bits, is far too short, and 1024 bits is too short as well. Cisco’s SSH guide asks for 2048 bits or more (4096 where the device supports it), and as of November 2026 Cisco IOS XE 17.11.1 and later refuse RSA keys under 2048 bits for SSH by default. Packet Tracer accepts 2048.

crypto key generate rsa دەپرسێت چەند درێژ بێت. وەڵامی بنەڕەتی، ⁦512⁩ ، زۆر کورتە و ⁦1024⁩ کورتە. ڕێنمایی Cisco داوای ⁦2048⁩ یان زیاتر دەکات (⁦4096⁩ ئەگەر ئامێرەکە پشتگیری بکات) و تا تشرینی دووەمی ⁦2026⁩، ⁦Cisco IOS XE 17.11.1⁩ و دواتر کەمتر لە ⁦2048⁩ بۆ بە بنەڕەت ڕەت دەکەنەوە. ⁦Packet Tracer 2048⁩ وەردەگرێت.

Key generation (Packet Tracer / IOS 15 output)دروستکردنی کلیل (دەرچوونی ⁦Packet Tracer / IOS 15⁩)TEXT
SW1(config)#ip domain-name example.com
SW1(config)#crypto key generate rsa
The name for the keys will be: SW1.example.com
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.

How many bits in the modulus [512]: 2048
% Generating 2048 bit RSA keys, keys will be non-exportable...[OK]

%SSH-5-ENABLED: SSH 1.99 has been enabled
SW1(config)#ip ssh version 2
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 3

host name + domain name = the key’s label.

+ = ناوی .

Lineدێڕی 4

Older switch software (IOS 12.2) offers 360 to 2048 here; 2048 works on both.

کۆنتری ⁦(IOS 12.2)⁩ لێرەدا ⁦360⁩ تا ⁦2048⁩ پێشنیار دەکات؛ ⁦2048⁩ لەسەر هەردووکیان کار دەکات.

Lineدێڕی 11

1.99 = versions 1 and 2 are both on; the next line leaves only version 2. A timestamp may appear in front of the message.

⁦1.99⁩ = وەشانی 1 و 2 هەردووکیان کاران؛ دێڕی دواتر تەنیا وەشانی 2 دەهێڵێتەوە. لەوانەیە کاتێک لە پێش پەیامەکەوە دەربکەوێت.

Bars for RSA key sizes for SSH, as of November 2026: 512 bits — broken, never; 1024 bits — too short, old labs only; 2048 bits — minimum today; 3072 bits — stronger; 4096 bits — strongest, slower to create. Note: IOS XE 17.11.1 and later refuse RSA keys under 2048 bits for SSH.شریتی قەبارەی کلیلی RSA بۆ SSH، تا تشرینی دووەمی 2026: 512 بیت — شکێنراوە، هەرگیز؛ 1024 بیت — زۆر کورتە، تەنیا تاقیکردنەوەی کۆن؛ 2048 بیت — کەمترینی ئەمڕۆ؛ 3072 بیت — بەهێزتر؛ 4096 بیت — بەهێزترین، دروستکردنی هێواشترە. تێبینی: IOS XE 17.11.1 و دواتر کلیلی RSAی کەمتر لە 2048 بیت بۆ SSH ڕەت دەکەنەوە.
Longer keys are harder to break; 2048 bits is the floor. درێژتر شکاندنی قورسترە؛ ⁦2048⁩ کەمترین ئاستە.CêIT

A local user and SSH-only vty linesبەکارهێنەرێکی ناوخۆیی و هێڵەکانی VTYـی تەنیا SSH

With login local, the vty lines stop using a shared line password and ask for a username and its secret from the device’s own user list. transport input ssh closes the Telnet door: the lines now accept SSH and nothing else. Use secret, never password: a secret is stored as a hash, a password in clear text or as reversible type 7 (password types and secrets). To allow only the administrators’ PCs on the vty lines, add an access list later (vty access class).

بە login local، وازیان لە هاوبەشی هێڵ دێنن و و نهێنییەکەی لە لیستی خودی ئامێرەکە دەپرسن. transport input ssh دەرگای دادەخات: ئێستا هێڵەکان تەنیا وەردەگرن. secret بەکار بهێنە، هەرگیز password: نهێنی وەک هاش هەڵدەگیرێت، بە یان وەک جۆری 7ـی گەڕاوە (جۆرەکانی تێپەڕەوشە و نهێنی). بۆ ئەوەی تەنیا PCـی بەڕێوەبەران بگەنە ، دواتر زیاد بکە (⁦access-class⁩ لەسەر vty).

Users and vty linesبەکارهێنەرەکان و هێڵەکانی VTYTEXT
SW1(config)#username admin secret N3tLab!26
SW1(config)#line vty 0 15
SW1(config-line)#login local
SW1(config-line)#transport input ssh
SW1(config-line)#exit
SW1(config)#enable secret En@ble2026
SW1(config)#end
SW1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 1

Example secret: use your own long one. Never “cisco” — it is the first word every attacker tries.

نهێنیی نموونە: هی درێژی خۆت بەکار بهێنە. هەرگیز «cisco» — یەکەم وشەیە کە هەموو تاقی دەکاتەوە.

Lineدێڕی 4

Lines with transport input ssh refuse Telnet connections.

هێڵەکان بە transport input ssh پەیوەندیی ڕەت دەکەنەوە.

Connect from a PCلە PCـێکەوە پەیوەندی بکە

On PC1 open Desktop > Command Prompt and type ssh -l admin 192.168.1.10. The letter after the dash is a small L, for login: it names the user. The password you type is the user’s secret; enable then asks for the enable secret.

لەسەر ⁦PC1⁩ ⁦Desktop > Command Prompt⁩ بکەرەوە و ssh -l admin 192.168.1.10 بنووسە. ئەو پیتەی دوای داشەکە L ـی بچووکە، بۆ login: دیاری دەکات. ئەو دەینووسیت نهێنیی ؛ پاشان enable داوای enable secret دەکات.

PC1 in Packet Tracer⁦PC1⁩ لە Packet TracerTEXT
C:\>ssh -l admin 192.168.1.10

Password:

SW1>enable
Password:
SW1#
The command C:\>ssh -l admin 192.168.1.10 taken apart: ssh — the program; -l — l = login name; admin — the username; 192.168.1.10 — SW1’s SVI address. Then Password: — the secret of admin; nothing appears as you type. Below: Windows 10/11 and Linux have the same client: ssh admin@192.168.1.10. PuTTY: choose SSH, type the address, port 22.فەرمانی C:\>ssh -l admin 192.168.1.10 بەش بەش کراوە: ssh — بەرنامەکە؛ -l — l = ناوی چوونەژوورەوە؛ admin — ناوی بەکارهێنەر؛ 192.168.1.10 — ناونیشانی SVIـی SW1. پاشان Password: — نهێنیی admin؛ لە کاتی نووسیندا هیچ دەرناکەوێت. لە خوارەوە: Windows 10/11 و Linux هەمان کلاینتیان هەیە: ssh admin@192.168.1.10. PuTTY: SSH هەڵبژێرە، ناونیشانەکە بنووسە، پۆرت 22.
Four parts: program, option, user, address.چوار بەش: ، هەڵبژاردە، ، ناونیشان.CêIT

On a real Windows 10 or 11 computer the built-in OpenSSH client also accepts ssh admin@192.168.1.10. PuTTY and other terminal programs (for example SecureCRT) work too: choose SSH, type the address and keep port 22.

لەسەر ڕاستەقینەی ⁦Windows 10⁩ یان ⁦11⁩، کلاینتی ناوخۆیی OpenSSH ssh admin@192.168.1.10ـیش وەردەگرێت. PuTTY و تری (بۆ نموونە SecureCRT)ـیش کار دەکەن: SSH هەڵبژێرە، ناونیشانەکە بنووسە و ⁦22⁩ وەک خۆی بهێڵەوە.

The first connection: check the keyیەکەم پەیوەندی: کلیلەکە بپشکنە

The first time a real SSH client meets a device, it does not know the device’s key yet, so it shows the key’s fingerprint and asks whether to trust it. This is the moment that stops an impostor: if someone has put a fake device in the path, its key will be different. Compare the fingerprint with the one your administrator recorded before you accept it.

یەکەم جار کە کلاینتێکی ڕاستەقینەی ئامێرێک دەبینێت، هێشتا ناناسێت، بۆیە پەنجەمۆری پیشان دەدات و دەپرسێت متمانەی پێ بکات یان نا. ئەمە ئەو ساتەیە کە ساختەکار ڕادەگرێت: ئەگەر کەسێک ئامێرێکی ساختەی لە ڕێگەکەدا دانابێت، جیاواز دەبێت. پێش قبووڵکردن، پەنجەمۆرەکە لەگەڵ ئەوەی تۆماری کردووە بەراورد بکە.

A redrawn SSH client alert (not a screenshot): the host key of 192.168.1.10 is not known yet; no proof yet that it is the device you think it is; key fingerprint (example) ssh-rsa 2048 SHA256:Q3k9…tW7c; buttons Accept, Connect Once and Cancel. Notes on the right: Accept — trust it and remember it; Connect Once — ask me again next time; Cancel — stop, nothing is sent; key changed later — stop and ask why. Below: check the fingerprint with the administrator before you accept it; Windows ssh asks the same with “Are you sure you want to continue connecting (yes/no/[fingerprint])?”.ئاگادارییەکی کلاینتی SSH کە دووپاتە کێشراوەتەوە (نەک وێنەی شاشە): کلیلی میوانگری 192.168.1.10 هێشتا نەناسراوە؛ هێشتا بەڵگە نییە کە ئەوە ئەو ئامێرەیە کە بیری لێ دەکەیتەوە؛ پەنجەمۆری کلیل (نموونە) ssh-rsa 2048 SHA256:Q3k9…tW7c؛ دوگمەکانی Accept، Connect Once و Cancel. تێبینییەکان لە لای ڕاست: Accept — متمانەی پێ بکە و لەبیری بگرە؛ Connect Once — جاری داهاتوو دووپاتە بپرسە؛ Cancel — ڕابوەستە، هیچ نانێردرێت؛ دواتر کلیلەکە گۆڕا — ڕابوەستە و هۆکارەکەی بپرسە. لە خوارەوە: پێش قبووڵکردن پەنجەمۆرەکە لەگەڵ بەڕێوەبەرەکە بەراورد بکە؛ ssh ـی Windows هەمان پرسیار دەکات بە «Are you sure you want to continue connecting (yes/no/[fingerprint])?».
Accept a key only after checking it; a changed key is a warning sign.تەنیا دوای پشکنین قبووڵ بکە؛ گۆڕاو نیشانەی مەترسییە.CêIT

Check that SSH is workingبپشکنە کە SSH کار دەکات

show ip ssh tells you whether SSH is enabled and which version. show ssh lists the sessions that are open right now, with the encryption they use and the user’s name.

show ip ssh پێت دەڵێت ئایا کارایە و کام وەشان. show ssh ئەو دانیشتنانە ڕیز دەکات کە ئێستا کراوەن، لەگەڵ ئەو بەکاری دەهێنن و .

VerificationپشکنینTEXT
SW1#show ip ssh
SSH Enabled - version 2.0
Authentication timeout: 120 secs; Authentication retries: 3

SW1#show ssh
Connection Version Mode Encryption  Hmac          State           Username
0          2.0     IN   aes128-ctr  hmac-sha2-256 Session started admin
0          2.0     OUT  aes128-ctr  hmac-sha2-256 Session started admin
%No SSHv1 server connections running.
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 2

“version 2.0” after ip ssh version 2; “1.99” would mean versions 1 and 2. Real IOS XE prints more lines here, such as the algorithms and the key’s modulus size.

«⁦version 2.0⁩» دوای ip ssh version 2؛ «⁦1.99⁩» واتە وەشانی 1 و ⁦2. IOS XE⁩ـی ڕاستەقینە لێرە دێڕی زیاتر چاپ دەکات، وەک و قەبارەی .

Lineدێڕی 7-8

One session = one IN and one OUT line. The cipher names depend on your IOS version and on the client.

یەک دانیشتن = یەک دێڕی IN و یەک دێڕی OUT. ناوی بەپێی IOS و کلاینتەکە دەگۆڕێن.

Why the first ping failsبۆچی یەکەم پینگ سەرناکەوێت

Before you try SSH, test the path with ping 192.168.1.10. On a fresh lab the first echo usually times out and the other three succeed. Nothing is wrong: PC1 first has to learn the switch’s MAC address with ARP, and that echo is lost while it waits (the ARP delay). Ping again and all four succeed.

پێش تاقیکردنەوەی ، ڕێگەکە بە ping 192.168.1.10 تاقی بکەرەوە. لە تاقیکردنەوەیەکی تازەدا یەکەم echo زۆرجار کاتی بەسەر دەچێت و سێیەکەی تر سەردەکەون. هیچ شتێک هەڵە نییە: ⁦PC1⁩ سەرەتا دەبێت بە فێر ببێت و ئەو echoـیە لە کاتی چاوەڕوانیدا لەدەست دەچێت (دواکەوتنی ARP). دووپاتە بکە و هەر چواریان سەردەکەون.

The first ping of a new lab (Packet Tracer; the round-trip lines that follow are left out)یەکەم پینگی تاقیکردنەوەیەکی نوێ (Packet Tracer؛ دێڕەکانی کاتی چوون و هاتنەوە لابراون)TEXT
C:\>ping 192.168.1.10

Pinging 192.168.1.10 with 32 bytes of data:

Request timed out.
Reply from 192.168.1.10: bytes=32 time<1ms TTL=255
Reply from 192.168.1.10: bytes=32 time<1ms TTL=255
Reply from 192.168.1.10: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.1.10:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Four echo rows. Echo 1: ARP first, “Who has 192.168.1.10?” then a reply — Request timed out. Echo 2: MAC address now known — Reply from 192.168.1.10. Echoes 3 and 4: Reply from 192.168.1.10. Below: Sent = 4, Received = 3 is normal the first time; ping again for 4 of 4.چوار ڕیزی echo. Echo 1: سەرەتا ARP، «192.168.1.10 هی کێیە؟» پاشان وەڵام — Request timed out. Echo 2: ناونیشانی MAC ئێستا زانراوە — Reply from 192.168.1.10. Echo 3 و 4: Reply from 192.168.1.10. لە خوارەوە: Sent = 4، Received = 3 بۆ یەکەم جار ئاساییە؛ دووپاتە پینگ بکە بۆ 4 لە 4.
One lost echo on the first try is ARP, not a fault.یەک echoـی لەدەستچوو لە یەکەم هەوڵدا ، نەک هەڵە.CêIT

Common mistakesهەڵە باوەکان

Exercisesڕاهێنانەکان

ExerciseڕاهێنانSecure remote management (practical exam)بەڕێوەبردنی پارێزراو لە دوورەوە (تاقیکردنەوەی کردەیی)

A 2960 switch must be named IT_Switch and managed securely from the PCs of its LAN at 192.168.10.240/24. The task also asked for a “type-7 password” to move from user mode to privileged mode. Write the whole configuration — and say what you use instead of a type-7 password, and why.

⁦2960⁩ دەبێت ناوی ⁦IT_Switch⁩ بێت و لە PCـەکانی بە ⁦192.168.10.240/24⁩ بە پارێزراوی بەڕێوە ببرێت. ئەرکەکە هەروەها داوای « جۆری 7»ی کردبوو بۆ چوون لە بۆ . هەموو بنووسە — و بڵێ لەبری جۆری 7 چی بەکار دەهێنیت و بۆچی.

Hintئاماژە

Follow the seven-step checklist, then replace the weak password with a secret.

لیستی پشکنینی حەوت هەنگاوەکە پەیڕەو بکە، پاشان لاوازەکە بە نهێنییەک بگۆڕە.

Show answerوەڵامەکە پیشان بدە
A model answer (prompts shortened)وەڵامێکی نموونە (دەقەکانی داواکردن کورت کراونەتەوە)TEXT
Switch(config)#hostname IT_Switch
IT_Switch(config)#interface vlan 1
IT_Switch(config-if)#ip address 192.168.10.240 255.255.255.0
IT_Switch(config-if)#no shutdown
IT_Switch(config-if)#exit
IT_Switch(config)#ip domain-name example.com
IT_Switch(config)#crypto key generate rsa
How many bits in the modulus [512]: 2048
IT_Switch(config)#ip ssh version 2
IT_Switch(config)#username admin secret Str0ng-Exam!Pass
IT_Switch(config)#line vty 0 15
IT_Switch(config-line)#login local
IT_Switch(config-line)#transport input ssh
IT_Switch(config-line)#exit
IT_Switch(config)#enable secret An0ther-Long!Secret
IT_Switch(config)#end
IT_Switch#copy running-config startup-config

Instead of enable password + service password-encryption (type 7), use enable secret: type 7 only hides the text and can be reversed by free tools in seconds, while a secret is stored as a one-way hash (type 9 scrypt on current IOS XE). Never use “Cisco” or “cisco” as a password: it is the first word attackers try.

لەبری enable password + service password-encryption (جۆری ⁦7⁩)، enable secret بەکار بهێنە: جۆری 7 تەنیا دەقەکە دەشارێتەوە و بە ئامرازی بێبەرانبەر لە چەند چرکەیەکدا دەگەڕێندرێتەوە، بەڵام نهێنی وەک هاشێکی یەک‌ئاڕاستە هەڵدەگیرێت (جۆری 9ـی scrypt لەسەر IOS XEـی ئێستا). هەرگیز «Cisco» یان «cisco» وەک بەکار مەهێنە: یەکەم وشەیە کە تاقی دەکەنەوە.

ExerciseڕاهێنانFrom Telnet to SSHلە Telnetـەوە بۆ SSH

A switch still has the old Telnet lab: line vty 0 4, password vlanPass, login. List the commands that turn it into an SSH-only switch with the user netadmin.

هێشتا تاقیکردنەوە کۆنەکەی هەیە: line vty 0 4، password vlanPass، login. ئەو ڕیز بکە کە دەیکەن بە تەنیا بە netadmin.

Show answerوەڵامەکە پیشان بدە
Answer (the switch already has the host name SW1)وەڵام (سویچەکە پێشتر ناوی میوانگری ⁦SW1⁩ـی هەیە)TEXT
SW1(config)#ip domain-name example.com
SW1(config)#crypto key generate rsa
How many bits in the modulus [512]: 2048
SW1(config)#ip ssh version 2
SW1(config)#username netadmin secret <a long secret>
SW1(config)#line vty 0 15
SW1(config-line)#no password
SW1(config-line)#login local
SW1(config-line)#transport input ssh
SW1(config-line)#end
SW1#copy running-config startup-config

no password removes the old shared line password; login local and transport input ssh do the rest. All 16 lines are covered by 0 15.

no password هاوبەشی کۆنی هێڵ لادەبات؛ login local و transport input ssh ئەوی تر دەکەن. هەر ⁦16⁩ هێڵەکە بە 0 15 دەگیرێنەوە.

ExerciseڕاهێنانRead the PC sessionدانیشتنی PC بخوێنەوە

In another lab the switch’s management SVI is interface vlan 7 with 192.168.1.7. Explain each part of ssh -l Cisco 192.168.1.7, and why the first ping 192.168.1.7 before it showed one “Request timed out”.

لە تاقیکردنەوەیەکی تردا SVIـی بەڕێوەبردنی interface vlan 7ـە بە ناونیشانی ⁦192.168.1.7⁩. هەر بەشێکی ssh -l Cisco 192.168.1.7 ڕوون بکەرەوە و بڵێ بۆچی یەکەم ping 192.168.1.7 پێش ئەو، یەک «Request timed out»ی پیشان دا.

Show answerوەڵامەکە پیشان بدە

ssh is the client program; -l (small L, “login”) introduces the user name Cisco; 192.168.1.7 is the switch’s SVI (interface vlan 7 — PC1’s switch port was put into VLAN 7 as well, so the PC can reach it). The first ping lost one echo because PC1 first used ARP to find the switch’s MAC address. (A better user name than “Cisco” is anything an attacker cannot guess.)

ssh کلاینتە؛ -l (L ـی بچووک، «login») Cisco دەناسێنێت؛ ⁦192.168.1.7 SVI⁩ـی (interface vlan 7؛ ⁦PC1⁩ لەسەر خرایە ناو ⁦VLAN 7⁩، بۆ ئەوەی PCـەکە پێی بگات). یەکەم یەک echoـی لەدەستدا چونکە ⁦PC1⁩ سەرەتا بەکار هێنا بۆ دۆزینەوەی . ( باشتر لە «Cisco» هەر شتێکە کە نەتوانێت بیپێشبینی بکات.)

Summaryکورتە

  • A layer 2 switch is reached through an SVI: interface vlan 1, ip address …, no shutdown, plus ip default-gateway for other networks.
  • Remote sessions enter through vty lines — secure all of them (line vty 0 15).
  • Telnet (port 23) sends everything as plain text — lab demonstration only. SSH (port 22) encrypts, proves the device and checks the user.
  • SSH set-up: hostname, ip domain-name, crypto key generate rsa (2048 bits or more), ip ssh version 2, username … secret …, line vty 0 15 + login local + transport input ssh, save.
  • Connect with ssh -l admin 192.168.1.10 (or ssh admin@…, PuTTY); check the host key on the first connection.
  • Verify with show ip ssh and show ssh; a lost first ping is ARP.
  • چینی 2 لە ڕێگەی SVIـەوە دەگەیەنرێت: interface vlan 1، ip address …، no shutdown، لەگەڵ ip default-gateway بۆ تر.
  • دانیشتنە دوورەکان لە ڕێگەی دێن — هەموویان بپارێزە (line vty 0 15).
  • ( ⁦23⁩) هەموو شتێک وەک دەنێرێت — تەنیا بۆ نمایشی تاقیگە. ( ⁦22⁩) شفرە دەکات، ئامێرەکە دەسەلمێنێت و دەپشکنێت.
  • ڕێکخستنی : hostname، ip domain-name، crypto key generate rsa (⁦2048⁩ یان زیاتر)، ip ssh version 2، username … secret …، line vty 0 15 + login local + transport input ssh، پاشەکەوت.
  • بە ssh -l admin 192.168.1.10 (یان ssh admin@…، PuTTY) پەیوەندی بکە؛ لە یەکەم پەیوەندیدا ئامێرەکە بپشکنە.
  • بە show ip ssh و show ssh بیپشکنە؛ لەدەستچوونی یەکەم .

Next chapter: split one switch into several networks — VLANs: many networks on one switch.

بەشی داهاتوو: یەک بکە بە چەند — VLAN: چەند ڕایەڵەیەک لەسەر یەک سویچ.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

VLANs: Many Networks on One SwitchVLAN: چەند ڕایەڵەیەک لەسەر یەک سویچ

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.

Appearanceڕووکار

Modeدۆخ
Styleشێواز
Coloursڕەنگەکان

Saved on this device only.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.