Часть 5: Настройка коммутатора для доступа по протоколу SSH
В части 5 вы настроите коммутатор в топологии для приёма подключений по протоколу SSH, а затем установите сеанс SSH с помощью программы Tera Term.
Шаг 1: Настройте базовые параметры коммутатора.
Шаг 2: Настройте коммутатор для доступа по протоколу SSH.
Для настройки протокола SSH на коммутаторе используйте те же команды, которые применялись для аналогичной настройки маршрутизатора в части 2.
Шаг 3: Установите подключение к коммутатору по протоколу SSH.
Запустите программу Tera Term на ПК-A, а затем установите подключение по протоколу SSH к интерфейсу SVI коммутатора S1.
Шаг 4: При необходимости устраните неполадки.
Удалось ли вам установить сеанс SSH с коммутатором?
Часть 6: Настройка протокола SSH в интерфейсе командной строки коммутатора
Клиент SSH интегрирован в операционную систему Cisco IOS и может запускаться из интерфейса командной строки. В части 6 вы установите подключение к маршрутизатору по протоколу SSH из интерфейса командной строки коммутатора.
Шаг 1: Посмотрите, какие параметры доступны для клиента SSH в Cisco IOS.
Введите вопросительный знак ( ? ), чтобы отобразить варианты параметров для команды ssh .
Select encryption algorithm
Log in using this user name
Select HMAC algorithm
Connect to this port
Specify SSH Protocol Version
Specify vrf name
IP address or hostname of a remote system
Шаг 2: Установите подключение коммутатора S1 к маршрутизатору R1 по протоколу SSH.
a. Чтобы подключиться к маршрутизатору R1 по протоколу SSH, введите команду –ladmin . Это позволит вам войти в систему под именем admin . При появлении запроса в качестве пароля введите adminpass .
S1# ssh -l admin 192.168.1.1
Warning: Unauthorized Access is Prohibited!
© Корпорация Cisco и/или её дочерние компании, 2014. Все права защищены.
В данном документе содержится общедоступная информация корпорации Cisco.
Лабораторная работа: доступ к сетевым устройствам по протоколу SSH
b. Чтобы вернуться к коммутатору S1, не закрывая сеанс подключения к маршрутизатору R1 по протоколу SSH, нажмите клавиши Ctrl + Shift + 6 . Отпустите клавиши Ctrl + Shift + 6 и нажмите x . Откроется окно командной строки коммутатора с привилегированным режимом.
c. Чтобы вернуться к сеансу SSH на маршрутизаторе R1, нажмите клавишу ВВОД в пустом поле интерфейса командной строки. Чтобы открыть окно командной строки маршрутизатора, нажмите клавишу ВВОД ещё раз.
[Resuming connection 1 to 192.168.1.1 . ] R1#
d. Чтобы завершить сеанс SSH на маршрутизаторе R1, введите в окне командной строки команду exit .
[Connection to 192.168.1.1 closed by foreign host] S1#
Какие версии протокола SSH поддерживаются интерфейсом командной строки?
Вопросы на закрепление
Как предоставить доступ к сетевому устройству нескольким пользователям, у каждого из которых есть собственное имя пользователя?
© Корпорация Cisco и/или её дочерние компании, 2014. Все права защищены.
В данном документе содержится общедоступная информация корпорации Cisco.
Лабораторная работа: доступ к сетевым устройствам по протоколу SSH
Сводная таблица интерфейса маршрутизатора
Общие сведения об интерфейсах маршрутизаторов
Fast Ethernet 0/0
Fast Ethernet 0/1
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
Fast Ethernet 0/0
Fast Ethernet 0/1
Serial 0/1/0 (S0/1/0)
Serial 0/1/1 (S0/1/1)
Fast Ethernet 0/0
Fast Ethernet 0/1
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
Примечание . Чтобы узнать, каким образом настроен маршрутизатор, изучите интерфейсы для определения типа маршрутизатора и количества имеющихся на нём интерфейсов. Не существует эффективного способа перечислить все комбинации настроек для каждого класса маршрутизаторов. Эта таблица включает в себя идентификаторы возможных сочетаний Ethernet и последовательных интерфейсов в устройстве. В таблицу интерфейсов не включены иные типы интерфейсов, даже если они присутствуют на каком-либо определённом маршрутизаторе. В качестве примера можно привести интерфейс ISDN BRI. Строка в скобках — это принятое сокращение, которое может использоваться
Network notes
Командную строку (CLI) можно поделить на 4 основных режима управления:
1) User executive (User EXEC) mode — Непривилегированный (пользовательский) режим
2) Privileged executive (Privileged EXEC) mode — Привилегированный режим
3) Global configuration mode — Режим глобальной конфигурации
4) Specific configuration mode (interface, router, line,…) — Специализированные режимы конфигурации
Уровни привилегий по умолчанию (Default privilege levels):
Для User EXEC — level 1 (user mode)
Для Privileged EXEC — level 15 (enable mode)
Непривилегированный (пользовательский) режим — User EXEC mode:
Переход в специализированные режимы конфигурации осуществляется из режима глобальной конфигурации, например:
1) Режим конфигурации интерфейса F0/0
2. Имя маршрутизатора
Имя маршрутизатора настраивается через команду «hostname», например:
3. Перезагрузка маршрутизатора
Стандартная перезагрузка маршрутизатора выполняется командой «reload»
Перезагрузка маршрутизатора через заданное время (в примере 1 минута):
R1#reload in ?
Delay before reload (mmm or hhh:mm)
Данная конфигурация начнет работать только после выполнения обычной перезагрузки маршрутизатора. Позволяет сэкономить время на перезагрузке маршрутизатора, т.к. загружает уже распакованный образ из RAM (без участия ROMMON).
Для выполнения warm reboot необходимо выполнить команду:
Пароль на привилегированный режим (пароль на enable mode):
1) Enable password (Пароль «class» хранится в открытом виде)
Если сконфигурированы оба типа паролей, enable secret всегда имеет преимущество!
3) Enable secret с опциями шифрования (начиная с IOS 15.3(3)M)
Внимание. Type 7 password служит только для защиты вашего пароля от чтения «на лету», он легко может быть расшифрован как с помощью специальных ресурсов в сети, так и средствами Cisco IOS через key-chain.
Пароль password 7 в текущей конфигурации:
«login» — Требовать проверку пароля при входе на маршрутизатор через консоль или удаленно по протоколу Telnet (VTY).
Для работы через SSH обязательно требуется имя пользователя и пароль, для этого необходимо завести локального пользователя на маршрутизаторе и в настройках VTY указать login local, после чего маршрутизатор начнет просматривать локальную базу данных и запрашивать имя пользователя при входе через SSH или Telnet (см. п.8)
Задать минимальную длину паролей при их конфигурации (в примере минимальная длина паролей будет составлять 8 символов):
Самый общий тип баннера, отображается при любом типе соединения к маршрутизатору, для всех пользователей
# — разделительный символ. Любой символ, который не должен встречаться в тексте сообщения
Проверка работы баннера при подключении к маршрутизатору через Console:
6. Конфигурация интерфейсов
Пример конфигурации IP-адреса на интерфейсе и описания(description):
«no shutdown» — активация интерфейса (по-умолчанию интерфейс на маршрутизаторе имеет статус shutdown — выключен)
Сбросить настройки на интерфейсе (вернуть конфигурацию по умолчанию):
Проверка конфигурации на интерфейсе:
«show ip interface brief»
«show interface description»
7. Конфигурация маршрутизатора
1) Сохранение текущей конфигурации в NVRAM (энергонезависимую память):
R1#copy running-config tftp://10.0.0.2
Address or name of remote host [10.0.0.2]?
Destination filename [r1-confg]?
!!
1356 bytes copied in 1.268 secs (1069 bytes/sec)
R1#copy tftp://10.0.0.2/r1-confg running-config
Destination filename [running-config]?
Accessing tftp://10.0.0.2/r1-confg…
Loading r1-confg from 10.0.0.2 (via FastEthernet0/0): !
[OK — 1500 bytes]
1500 bytes copied in 1.360 secs (1103 bytes/sec)
4) Копирование на FTP сервер:
Создание пользователя и пароля для FTP клиента IOS:
R1#copy running-config ftp://10.0.0.2
Address or name of remote host [10.0.0.2]?
Destination filename [r1-confg]?
Writing r1-confg !
1421 bytes copied in 2.464 secs (577 bytes/sec)
5) Использование Archive функционала
Функционал появился в IOS 12.3(4)T и позволяет управлять конфигурациями маршрутизатора, а также производить логирование (user accounting).
«path» — путь сохранения конфигурации (поддерживается tftp:/ftp:/http:/https:/scp:/flash:/)
«write-memory» — сохранять конфигурацию на при каждом выполнении команды write-memory
«time-period» — период автоматического сохранения конфигурации (каждые 1440 мин = 24 часа)
«maximum» — количество файлов конфигурации
«show archive» — просмотр сохраненных конфигураций
На самом деле IOS сравнивает конфигурацию с текущей и меняет только то, что отличается, чтобы избежать потенциальной неработоспособности при полной замене конфигурации (в отличие от «copy path: running-config»)
Сравнение сохраненной конфигурации и текущей можно выполнить самому:
«+» обозначает, что конфигурация присутствует в startup-config, но отсутствует в running-config
«—» обозначает, что конфигурация присутствует в running-config, но отсутствует в startup-config
(аналог show | compare на Juniper)
Так же с помощью этой команды можно сравнивать разные файлы конфигурации, указав путь к ним путь (например конфигурацию на TFTP сервере и на Flash).
Существуют дополнительные полезные опции для команды configure replace:
«force» — заменить конфигурацию без подтверждения
«time — время в минутах (от 1 до 120) в течение которого будет произведен откат к последней текущей конфигурации (после ввода команды происходит сохранение running-config в archive) если не введена команда configure confirm, подтверждающая замену текущей конфигурации на указанную администратором. Очень полезно использовать при удаленной настройке, чтобы обезопасить себя (вместо команды #reload in).
!Замена конфигурации на выбранную администратором происходит сразу!
«list» — вывести список команд, которые маршрутизатор применяет при замене конфигурации на выбранную
«configure revert
«configure confirm» — подтвердить замененную конфигурацию (отката не произойдет)
Имеется удаленный доступ к маршрутизатору по SSH, который находится очень далеко. Мы не уверены в настройках, которые хотим на нем изменить, можно использовать archive для «безопасной настройки»:
1) Заходим на маршрутизатор и сохраняем конфигурацию. Конфигурация пишется в archive (если есть опция «write-memory»).
3) У нас есть 10 мин., чтобы безопасно что-либо настраивать удаленно, если все настроили, то необходимо прописать «configure confirm» для подтверждения настроек, если отвалились после неправильной настройки, то через 10 мин маршрутизатор возвратит последнюю рабочую конфигурацию и можно пробовать заново 🙂
Маршрутизатор предупредит за минуту до автоматического отката конфигурации:
R1#Rollback Confirmed Change: Rollback will begin in one minute. Enter «configure confirm» if you wish to keep what you’ve configured
%ARCHIVE_DIFF-5-ROLLBK_CNFMD_CHG_WARNING_ABSTIMER: System will rollback to config flash:-Feb—3-20-19-54.395-2 in one minute. Enter «configure confirm» if you wish to keep what you’ve configured
8. Защита IOS и конфигурации (IOS Resilient Configuration)
«secure boot-config» — сохраняет конфигурацию в flash, даже после «wr e», конфигурацию можно вытащить: «secure boot-config restore flash:restored_config».
Потом эту конфигурацию залить в running-config через команду «configure replace»
«secure boot-image» — IOS становится невидим на flash, IOS останется на флешке даже после форматирования (Осторожно! erase flash: полностью затрет флешку со всеми бекапами)
Отключить secure-image можно только из консоли маршрутизатора, не по SSH/Telnet!
9. Настройка Console/VTY; Local database маршрутизатора
1) Консоль (Console)
Синхронизация вывода debug и других служебных сообщений при выводе в консоль в консоль маршрутизатора (аналогично для VTY сессий):
Если по истечении 2 мин 30 сек в консоли не будет никакой активности, маршрутизатор сбросит соединение, необходимо будет вводить пароль на console заново, как при первом подключении.
«exec-timeout 0 0» — консольное/VTY соединение будет всегда активно.
2) VTY соединения (Telnet/SSH)
VTY — Virtual Terminal Line.
Для подключения к маршрутизатору по Telnet протоколу достаточно настроить пароль на enable (enable password или enable secret) и пароль на самой VTY (line vty).
По умолчанию при подключении к маршрутизатору через Telnet/SSH служебная информация и debug сообщения в консоль не выводятся.
Для вывода информации в удаленную консоль используется команда «terminal monitor»
Вывод в терминал работает только пока сессия активна, при повторном подключении необходимо включать «terminal monitor» заново.
По умолчанию все входящие соединения на маршрутизатор разрешены (transport input all)
Можно разрешить только SSH протокол в качестве входящего соединения на маршрутизатор (это рекомендуемая опция):
Можно разрешить входящие соединения только по Telnet (transport input telnet), либо комбинацию SSH+Telnet (transport input ssh telnet)
Команда «transport output» определяет по каким протоколам можно осуществлять исходящие соединения с данного маршрутизатора, в отличие от «transport input» данная команда доступна как для VTY, так и для Console.
Защита VTY от Brute-Force (необходима аутентификация с использованием имени пользователя), пример:
Инициатор соединения будет заблокирован на 60 сек, если в течение 30 сек будут 3 неудачные попытки входа. Работает как с Telnet, так и с SSH.
Отслеживание Telnet сессий (для предотвращения зависших соединений):
Выбор транспортного протокола, который Cisco IOS будет использовать по умолчанию в Console/VTY (по умолчанию используется Telnet — «default transport preferred»). Рекомендуемый вариант — «transport preferred none».
При ошибочном вводе команды в консоль, маршрутизатор попытается разрешить имя (т.к. ip domain lookup тоже включен по умолчанию), чтобы зайти на этот хост по Telnet. Естественно у него ничего не получится, но попытка разрешения имени занимает определенное время, что сильно мешает каждый раз, когда что-либо введено в консоль неправильно, что маршрутизатор не признает как свою команду.
R1#conft
Translating «conft»…domain server (255.255.255.255)
!
R1(config)#line console 0
R1(config)#transport preferred none
R1(config)#
R1#
R1#conft
^
% Invalid input detected at ‘^’ marker.
«transport preferred none» отключает поведение маршрутизатора по умолчанию, при котором он пытается разрешить все неправильно введенные команды (т.к. включен ip domain-lookup) и зайти на удаленный узел по Telnet (transport preferred telnet):
Настройка SSH:
Для настройки SSH на маршрутизаторе требуется:
— Уникальный hostname (отличный от Router)
— Доменное имя (требуется для генерации ключей)
— Пользователь в локальной базе данных (либо на сервере аутентификации/авторизации RADIUS, TACACS+)
— Сгенерированная пара RSA ключей
— Конфигурация VTY для использования локальной базы данных
— Принудительное задание версии SSH 2.0 (опционально)
— Конфигурация hostname рассматривается в разделе 2.
— Конфигурация доменного имени (в примере cisco.local):
«login local» — использовать local database маршрутизатора для аутентификации пользователей (данная команда применима и для Telnet).
Команда «login local» заменяет собой команду «login» и наоборот.
Конфигурация SSH версии 2.0 (Отключение совместимости с ранними версиями SSH):
По умолчанию работает SSH версии 1.99 — это значит используется SSHv2 и имеется обратная совместимость с SSHv1.5 (небезопасная версия протокола).
«show ip ssh» — посмотреть текущую версию и настройки SSH
Проверка работы SSH на локальном маршрутизаторе:
Максимальное время для входа на маршрутизатор по SSH (по умолчанию 120 сек). Если в течение 20 сек. не будет передачи данных к маршрутизатору, соединение будет сброшено.
Ограничение количества попыток (считаются неудачные попытки) входа по SSH:
При 3-ей неудачной попытке входа соединение будет сброшено.
9. Логирование
Типы лог сообщений и наиболее частые события, вызывающие эти сообщения:
0 Emergencies — System shutting down due to missing fan tray
1 Alerts — Temperature limit exceeded
2 Critical — Memory allocation failures
3 Errors — Interface Up/Down messages
4 Warnings — Configuration file written to server, via SNMP request
5 Notifications — Line protocol Up/Down
6 Information — Access-list violation logging
7 Debugging — Debug messages
Типы лог сообщений:
1) Console logging — отправлять лог сообщения в консоль
По умолчанию маршрутизатор отправляет все типы сообщений в консоль (level 7)
Отключить вывод сообщений в консоль:
524288 bytes — 512K. По умолчанию используется буфер размером 8192 bytes (зависит от платформы)
Так же по типу записываемых в буфер сообщений (в примере уровень 5 и ниже):
«show logging» — посмотреть логи на маршрутизаторе
Отправка сообщений на Syslog сервер (10.0.0.2 — IP адрес сервера):
Настройка формата лог сообщений:
1) Добавление порядковых номеров в лог сообщения
«localtime» — указывать время относительно настроенной временной зоны (по умолчанию относительно UTC)
«msec» — включать в лог миллисекунды
«show-timezone» — показывать временную зону в лог сообщениях
«year» — показывать год в лог сообщениях
datetime и uptime взаимоисключающие опции!
«hidekeys» — шифровать пароли в логах
«logging enable» — включить логирование конфига
«logging size 200» — длина очереди лог-сообщений (по умолчанию 100)
«notify syslog» — при внесении конфигурации отправлять syslog сообщения
Посмотреть лог сообщения (аккаунтинг): «show archive log config all»
Очистить логи: «clear archive log config»
Пример:
На маршрутизаторе R1 настроено логирование:
Смотрим логи на R1:
10. Настройка времени на маршрутизаторе и NTP
Посмотреть время на маршрутизаторе:
* — время не является точным (Time is not authoritative)
Конфигурация времени на маршрутизаторе (необходимо выставлять в UTC+0):
MSK — имя временной зоны
3 — положительное смещение относительно UTC в часах
Конфигурация NTP cервера (рекомендуется использовать):
«0.ru.pool.ntp.org» — адрес NTP сервера.
Можно конфигурировать несколько NTP серверов, которые будут выступать в качестве резервных, если основной станет недоступен.
Синхронизация времени в «календаре» с NTP (NTP по умолчанию синхронизирует только программные часы):
Просмотр конфигурации NTP:
«show ntp status»
«show ntp associations»
Настроить маршрутизатор в качестве NTP сервера:
Опционально можно указать stratum в конце команды (от 1 до 15).
11. Настройка имён(DNS)
Отключить разрешение имен в IP адреса (по умолчанию включено, если есть необходимость использовать маршрутизатор в качестве DNS, то эту опцию нужно оставить включенной):
Если в на маршрутизаторе необходимо использовать DNS, то лучше пользоваться настройкой «transport preferred none».
Добавить DNS сервер (в примере использован Google DNS):
Это позволяет маршрутизатору перенаправлять DNS запросы, если его указали в качестве DNS сервера (кеширующий DNS).
Задать соответствие Имя хоста — IP адрес (локальные DNS записи маршрутизатора):
R1#ping gw.local
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
.
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R1#ping google.com
Translating «google.com»…domain server (8.8.8.8) [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 77.37.252.24, timeout is 2 seconds:
.
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/5/12 ms
Проверка работы DNS на ПК (маршрутизатор выступает в качестве DNS сервера):
12. Уровни привилегий пользователей
На маршрутизаторе возможно разграничить доступ к доступным командам (настройкам и просмотру информации) различным пользователям, т.е. создать уровень привилегий для каждого из них.
По умолчанию используются level 1 — User EXEC mode и level 15 — Privileged EXEC mode (enable mode).
При создании уровня с 2 по 14 пользователь сможет выполнять только команды по умолчанию, которые разрешены для 1-ого уровня, пока ему не будут назначены определенные права на исполнение команд.
Посмотреть текущий уровень привилегий:
Все уровни выше 10-ого автоматически смогут выполнять эти команды.
Необходимо создать пользователя с уровнем 10 и его пароль на enable (в данном примере пароль: «QwE123»):
Т.к. при создании пользователя указывается его уровень привилегий явно, то при входе этого пользователя на маршрутизатор он будет сразу попадать в свой уровень без ввода пароля на enable. Если при этом пользователь совершит выход из привилегированного режима в User EXEC mode, выполнив команду «disable», то при повторной попытке зайти в привилегированный режим необходимо будет выполнить команду «enable 10» и ввести соответствующий пользователю пароль на enable.
(При создании учетной записи администратора с максимальным уровнем привилегий — username admin privilege 15 secret cisco123, так же не нужно будет вводить пароль на enable каждый раз при входе, т.к. будем всегда попадать в Privileged EXEC mode).
Такой подход по назначению уровней привилегий является устаревшим и неудобным. Следующим этапом, позволяющим более точно и удобно настраивать права пользователей на маршрутизаторе, является Role Based Access Control (или просто Parser View).
13. Role-based CLI access (Parser view)
Для работы Parser View на маршрутизаторе необходимо, чтобы был включен AAA, для более старых версий IOS еще и enable secret для перехода в Root View
Основная идея в том, что сначала настраивается шаблон с правами — View, а потом этот шаблон присваивается пользователю. Т.е. можно сказать, что пользователю назначается определенная роль на маршрутизаторе (например для Helpdesk).
В относительно старых версиях IOS (до 15.2) все настройки Parser View необходимо было делать из так называемого Root View
R1#enable view
Password: (пароль от enable)
R1#
*Mar 1 00:13:34.447: %PARSER-6-VIEW_SWITCH: successfully set to view ‘root’.
Root View может выполнять все команды Privilege level 15, а также создавать View.
Пример создания и настройки Parser View:
View1:
Можно выполнять все show команды кроме show ip route, производить конфигурацию любых интерфейсов (кроме команды shutdown/no shutdown на интерфейсе), производить настройку протоколов маршрутизации (кроме EIGRP, для него почему-то надо добавлять команду отдельно) только используя правило network.
Можно выполнять все show команды, производить конфигурацию любых интерфейсов, только в этом view можно использовать команду shutdown/no shutdown на интерфейсе, можно использовать все команды протоколов маршрутизации.
Secure Shell Configuration Guide Cisco IOS Release 15 M and T
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
Results
Chapter: Secure Shell Version 2 Support
Secure Shell Version 2 Support
The Secure Shell Version 2 Support feature allows you to configure Secure Shell (SSH) Version 2 (SSH Version 1 support was implemented in an earlier Cisco IOS software release). SSH runs on top of a reliable transport layer and provides strong authentication and encryption capabilities. The only reliable transport that is defined for SSH is TCP. SSH provides a means to securely access and securely execute commands on another computer over a network. The Secure Copy Protocol (SCP) feature that is provided with SSH allows for the secure transfer of files.
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the "Feature Information for Secure Shell Version 2 Support" section.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn . An account on Cisco.com is not required.
Contents
Prerequisites for Secure Shell Version 2 Support
Prior to configuring SSH,ensure that the required image is loaded on your router. The SSH server requires you to have a k9 (Triple Data Encryption Standard [3DES]) software image from Cisco IOS Release 12.3(4)T, 12.2(25)S, or 12.3(7)JA downloaded on to your router.
Note The SSH Version 2 server is supported in Cisco IOS Release 12.3(4)T, 12.3(2)XE, 12.2(25)S, and 12.3(7)JA; the SSH Version 2 client is supported beginning with Cisco IOS Release 12.3(7)T and is supported in Cisco IOS Release12.3(7)JA. (The SSH client runs both the SSH Version 1 protocol and the Version 2 protocol and is supported in both k8 and k9 images in Cisco IOS Release 12.3(4)T.)
For more information about downloading a software image, refer to Cisco IOS Configuration Fundamentals Configuration Guide , Release 12.4T and Cisco IOS Network Management Configuration Guide , Release 15.0 .
Restrictions for Secure Shell Version 2 Support
•SSH servers and SSH clients are supported in 3DES software images.
•Execution Shell, remote command execution, and SCP are the only applications supported.
•Rivest, Shamir, and Adelman (RSA) key generation is an SSH server-side requirement. Routers that act as SSH clients need not generate RSA keys.
•The RSA key pair size must be greater than or equal to 768.
•The following functionality is not supported:
Information About Secure Shell Version 2 Support
Secure Shell Version 2
The Secure Shell Version 2 Support feature allows you to configure SSH Version 2.
The configuration for the SSH Version 2 server is similar to the configuration for SSH Version 1. The ip ssh version command was introduced so that you may define which version of SSH to configure. If you do not configure this command, SSH by default runs in compatibility mode; that is, both SSH Version 1 and SSH Version 2 connections are honored.
Note SSH Version 1 is a protocol that has never been defined in a standard. If you do not want your router to fall back to the undefined protocol (Version 1), you should use the ip ssh version command and specify Version 2.
The ip ssh rsa keypair-name command was also introduced in Cisco IOS Release 12.3(4)T so that you can enable an SSH connection using the RSA keys that you have configured. Previously, SSH was linked to the first RSA keys that were generated (that is, SSH was enabled when the first RSA key pair was generated). The behavior still exists, but by using the ip ssh rsa keypair-name command, you can overcome that behavior. If you configure the ip ssh rsa keypair-name command with a key pair name, SSH is enabled if the key pair exists, or SSH will be enabled if the key pair is generated later. If you use this command to enable SSH, you are not forced to configure a hostname and a domain name, which was required in SSH Version 1 of the Cisco IOS software.
Note The login banner is supported in SSH Version 2, but it is not supported in Secure Shell Version 1.
Secure Shell Version 2 Enhancements
The SSH Version 2 Enhancements feature includes a number of additional capabilities such as supporting VRF-aware SSH, SSH debug enhancements, and Diffie-Hellman (DH) group exchange support.
The Cisco IOS SSH implementation has traditionally used 768-bit modulus, but with an increasing need for higher key sizes to accommodate DH Group 14 (2048 bits) and Group 16 (4096 bits) cryptographic applications a message exchange between the client and the server to establish the favored DH group becomes necessary. The ip ssh dh min size command was introduced in Cisco IOS Release 12.4(20)T so that you can configure the modulus size on the SSH server. In addition to this the ssh command was extended to add VRF awareness to the SSH client-side functionality through which the VRF instance name in the client is provided with the IP address to look up the correct routing table and establish a connection.
Debugging was enhanced by modifying SSH debug commands. The debug ip ssh command was extended to allow you to simplify the debugging process. Previously, this command printed all debug messages related to SSH regardless of what was specifically required. The behavior still exists, but if you configure the debug ip ssh command with a keyword messages are limited to information specified by the keyword.
Secure Shell Version 2 Enhancements for RSA Keys
Cisco IOS SSH Version 2 (SSHv2) supports keyboard-interactive and password-based authentication methods. The SSHv2 Enhancements for RSA Keys feature also supports RSA-based public key authentication for the client and the server.
User authentication—RSA-based user authentication uses a private/public key pair associated with each user for authentication. The user must generate a private/public key pair on the client and configure a public key on the Cisco IOS SSH server to complete the authentication.
An SSH user trying to establish the credentials provides an encrypted signature using the private key. The signature and the user’s public key are sent to the SSH server for authentication. The SSH server computes a hash over the public key provided by the user. The hash is used to determine if the server has a matching entry. If a match is found, an RSA-based message verification is performed using the public key. Hence, the user is authenticated or denied access based on the encrypted signature.
Server authentication—While establishing an SSH session, the Cisco IOS SSH client authenticates the SSH server by using the server host keys available during the key exchange phase. SSH server keys are used to identify the SSH server. These keys are created at the time of enabling SSH and must be configured on the client.
For server authentication, the Cisco IOS SSH client must assign a host key for each server. When the client tries to establish an SSH session with a server, it receives the signature of the server as part of the key exchange message. If the strict host key checking flag is enabled on the client, the client checks if it has the host key entry corresponding to the server. If a match is found, the client tries to validate the signature using the server host key. If the server is successfully authenticated, the session establishment continues; otherwise it is terminated and displays a "Server Authentication Failed" message.
Note Storing public keys on a server uses memory; therefore, the number of public keys configurable on an SSH server is restricted to ten users, with a maximum of two public keys per user.
Note RSA-based user authentication is supported by the Cisco IOS server, but Cisco IOS clients cannot propose public key as an authentication method. If the Cisco IOS server receives a request from an open SSH client for RSA-based authentication, the server accepts the authentication request.
Note For server authentication, configure the RSA public key of the server manually and configure the ip ssh stricthostkeycheck command on the Cisco IOS SSH client.
SNMP Trap Generation
Effective with Cisco IOS Release 12.4(17), Simple Network Management Protocol (SNMP) traps are generated automatically when an SSH session terminates if the traps have been enabled and SNMP debugging has been turned on. For information about enabling SNMP traps, see the " Configuring SNMP Support " module in the Cisco IOS Network Management Configuration Guide , Release 15.0 .
Note When you configure the snmp-server host command, the IP address must be the address of the PC that has the SSH (telnet) client and that has IP connectivity to the SSH server. For an example of an SNMP trap generation configuration, see the "Example: Setting an SNMP Trap" section."
You must also turn on SNMP debugging using the debug snmp packet command to display the traps. The trap information includes information such as the number of bytes sent and the protocol that was used for the SSH session. For an example of SNMP debugging, see the "Example: SNMP Debugging" section.
SSH Keyboard Interactive Authentication
The SSH Keyboard Interactive Authentication feature, also known as Generic Message Authentication for SSH, is a method that can be used to implement different types of authentication mechanisms. Basically, any currently supported authentication method that requires only user input can be performed with this feature. The feature is automatically enabled.
The following methods are supported:
•SecurID and hardware tokens printing a number or a string in response to a challenge sent by the server
•Pluggable Authentication Module (PAM)
•S/KEY (and other One-Time-Pads)
For examples of various scenarios in which the SSH Keyboard Interactive Authentication feature has been automatically enabled, see the "Examples: SSH Keyboard Interactive Authentication" section.
Secure Shell Configuration Guide, Cisco IOS Release 12.2SX
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
Book Title
Secure Shell Configuration Guide, Cisco IOS Release 12.2SX
Secure Shell Version 2 Support
View with Adobe Reader on a variety of devices
Results
Chapter: Secure Shell Version 2 Support
Secure Shell Version 2 Support
The Secure Shell Version 2 Support feature allows you to configure Secure Shell (SSH) Version 2 (SSH Version 1 support was implemented in an earlier Cisco IOS software release). SSH runs on top of a reliable transport layer and provides strong authentication and encryption capabilities. The only reliable transport that is defined for SSH is TCP. SSH provides a means to securely access and securely execute commands on another computer over a network. The Secure Copy Protocol (SCP) feature that is provided with SSH allows for the secure transfer of files.
- Finding Feature Information
- Prerequisites for Secure Shell Version 2 Support
- Restrictions for Secure Shell Version 2 Support
- Information About Secure Shell Version 2 Support
- How to Configure Secure Shell Version 2 Support
- Configuration Examples for Secure Shell Version 2 Support
- Where to Go Next
- Additional References
- Feature Information for Secure Shell Version 2 Support
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the Feature Information Table at the end of this document.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Prerequisites for Secure Shell Version 2 Support
Prior to configuring SSH,ensure that the required image is loaded on your router. The SSH server requires you to have a k9 (Triple Data Encryption Standard [3DES]) software image from Cisco IOS Release 12.3(4)T, 12.2(25)S, or 12.3(7)JA downloaded on to your router.
Note | The SSH Version 2 server is supported in Cisco IOS Release 12.3(4)T, 12.3(2)XE, 12.2(25)S, and 12.3(7)JA; the SSH Version 2 client is supported beginning with Cisco IOS Release 12.3(7)T and is supported in Cisco IOS Release12.3(7)JA. (The SSH client runs both the SSH Version 1 protocol and the Version 2 protocol and is supported in both k8 and k9 images in Cisco IOS Release 12.3(4)T.) |
For more information about downloading a software image, refer to Cisco IOS Configuration Fundamentals Configuration Guide, Release 12.4T and Cisco IOS Network Management Configuration Guide, Release 15.0.
Restrictions for Secure Shell Version 2 Support
- SSH servers and SSH clients are supported in 3DES software images.
- Execution Shell, remote command execution, and SCP are the only applications supported.
- Rivest, Shamir, and Adelman (RSA) key generation is an SSH server-side requirement. Routers that act as SSH clients need not generate RSA keys.
- The RSA key pair size must be greater than or equal to 768.
- The following functionality is not supported:
- Port forwarding
- Compression
Information About Secure Shell Version 2 Support
- Secure Shell Version 2
- Secure Shell Version 2 Enhancements
- Secure Shell Version 2 Enhancements for RSA Keys
- SNMP Trap Generation
- SSH Keyboard Interactive Authentication
Secure Shell Version 2
The Secure Shell Version 2 Support feature allows you to configure SSH Version 2.
The configuration for the SSH Version 2 server is similar to the configuration for SSH Version 1. The ip ssh version command was introduced so that you may define which version of SSH to configure. If you do not configure this command, SSH by default runs in compatibility mode; that is, both SSH Version 1 and SSH Version 2 connections are honored.
Note SSH Version 1 is a protocol that has never been defined in a standard. If you do not want your router to fall back to the undefined protocol (Version 1), you should use the ip ssh version command and specify Version 2. The ip ssh rsa keypair-name command was also introduced in Cisco IOS Release 12.3(4)T so that you can enable an SSH connection using the RSA keys that you have configured. Previously, SSH was linked to the first RSA keys that were generated (that is, SSH was enabled when the first RSA key pair was generated). The behavior still exists, but by using the ip ssh rsa keypair-name command, you can overcome that behavior. If you configure the ip ssh rsa keypair-name command with a key pair name, SSH is enabled if the key pair exists, or SSH will be enabled if the key pair is generated later. If you use this command to enable SSH, you are not forced to configure a hostname and a domain name, which was required in SSH Version 1 of the Cisco IOS software.
Note The login banner is supported in SSH Version 2, but it is not supported in Secure Shell Version 1. Secure Shell Version 2 Enhancements
The SSH Version 2 Enhancements feature includes a number of additional capabilities such as supporting VRF-aware SSH, SSH debug enhancements, and Diffie-Hellman (DH) group exchange support.
The Cisco IOS SSH implementation has traditionally used 768-bit modulus, but with an increasing need for higher key sizes to accommodate DH Group 14 (2048 bits) and Group 16 (4096 bits) cryptographic applications a message exchange between the client and the server to establish the favored DH group becomes necessary. The ip ssh dh min size command was introduced in Cisco IOS Release 12.4(20)T so that you can configure the modulus size on the SSH server. In addition to this the ssh command was extended to add VRF awareness to the SSH client-side functionality through which the VRF instance name in the client is provided with the IP address to look up the correct routing table and establish a connection.
Debugging was enhanced by modifying SSH debug commands. The debug ip ssh command was extended to allow you to simplify the debugging process. Previously, this command printed all debug messages related to SSH regardless of what was specifically required. The behavior still exists, but if you configure the debug ip ssh command with a keyword messages are limited to information specified by the keyword.
Secure Shell Version 2 Enhancements for RSA Keys
Cisco IOS SSH Version 2 (SSHv2) supports keyboard-interactive and password-based authentication methods. The SSHv2 Enhancements for RSA Keys feature also supports RSA-based public key authentication for the client and the server.
User authentication—RSA-based user authentication uses a private/public key pair associated with each user for authentication. The user must generate a private/public key pair on the client and configure a public key on the Cisco IOS SSH server to complete the authentication.
An SSH user trying to establish the credentials provides an encrypted signature using the private key. The signature and the user’s public key are sent to the SSH server for authentication. The SSH server computes a hash over the public key provided by the user. The hash is used to determine if the server has a matching entry. If a match is found, an RSA-based message verification is performed using the public key. Hence, the user is authenticated or denied access based on the encrypted signature.
Server authentication—While establishing an SSH session, the Cisco IOS SSH client authenticates the SSH server by using the server host keys available during the key exchange phase. SSH server keys are used to identify the SSH server. These keys are created at the time of enabling SSH and must be configured on the client.
For server authentication, the Cisco IOS SSH client must assign a host key for each server. When the client tries to establish an SSH session with a server, it receives the signature of the server as part of the key exchange message. If the strict host key checking flag is enabled on the client, the client checks if it has the host key entry corresponding to the server. If a match is found, the client tries to validate the signature using the server host key. If the server is successfully authenticated, the session establishment continues; otherwise it is terminated and displays a “Server Authentication Failed” message.
Note Storing public keys on a server uses memory; therefore, the number of public keys configurable on an SSH server is restricted to ten users, with a maximum of two public keys per user. Note RSA-based user authentication is supported by the Cisco IOS server, but Cisco IOS clients cannot propose public key as an authentication method. If the Cisco IOS server receives a request from an open SSH client for RSA-based authentication, the server accepts the authentication request. Note For server authentication, configure the RSA public key of the server manually and configure the ip ssh stricthostkeycheck command on the Cisco IOS SSH client. SNMP Trap Generation
Effective with Cisco IOS Release 12.4(17), Simple Network Management Protocol (SNMP) traps are generated automatically when an SSH session terminates if the traps have been enabled and SNMP debugging has been turned on. For information about enabling SNMP traps, see the Configuring SNMP Support module in the Cisco IOS Network Management Configuration Guide, Release 15.0 .
Note When you configure the snmp-server host command, the IP address must be the address of the PC that has the SSH (telnet) client and that has IP connectivity to the SSH server. For an example of an SNMP trap generation configuration, see the Example Setting an SNMP Trap.” You must also turn on SNMP debugging using the debug snmp packet command to display the traps. The trap information includes information such as the number of bytes sent and the protocol that was used for the SSH session. For an example of SNMP debugging, see the Example SNMP Debugging.
SSH Keyboard Interactive Authentication
The SSH Keyboard Interactive Authentication feature, also known as Generic Message Authentication for SSH, is a method that can be used to implement different types of authentication mechanisms. Basically, any currently supported authentication method that requires only user input can be performed with this feature. The feature is automatically enabled.
The following methods are supported:
- Password
- SecurID and hardware tokens printing a number or a string in response to a challenge sent by the server
- Pluggable Authentication Module (PAM)
- S/KEY (and other One-Time-Pads)
For examples of various scenarios in which the SSH Keyboard Interactive Authentication feature has been automatically enabled, see the Examples SSH Keyboard Interactive Authentication.
How to Configure Secure Shell Version 2 Support
- Configuring a Router for SSH Version 2 Using a Hostname and Domain Name
- Configuring a Router for SSH Version 2 Using RSA Key Pairs
- Configuring the Cisco IOS SSH Server to Perform RSA-Based User Authentication
- Configuring the Cisco IOS SSH Client to Perform RSA-Based Server Authentication
- Starting an Encrypted Session with a Remote Device
- Enabling Secure Copy Protocol on the SSH Server
- Verifying the Status of the Secure Shell Connection Using the show ssh Command
- Verifying the Secure Shell Status
- Monitoring and Maintaining Secure Shell Version 2
Configuring a Router for SSH Version 2 Using a Hostname and Domain Name
Perform this task to configure a router for SSH Version 2 using a hostname and domain name. You may also configure SSH Version 2 by using the RSA key pair configuration (see the Configuring a Router for SSH Version 2 Using RSA Key Pairs).
SUMMARY STEPS
2. configure terminal
3. hostname hostname
4. ip domain-name name
5. crypto key generate rsa
6. ip ssh [ time-out seconds | authentication-retries integer ]
7. ip ssh version [ 1 | 2 ]
Enables privileged EXEC mode.
- Enter your password if prompted.
Router# configure terminal
Enters global configuration mode.
Router(config)# hostname cisco 7200
Configures a hostname for your router.
Router(config)# ip domain-name example.com
Configures a domain name for your router.
Router(config)# crypto key generate rsa
Enables the SSH server for local and remote authentication.
Router(config)# ip ssh time-out 120
(Optional) Configures SSH control variables on your router.
Router(config)# ip ssh version 1
(Optional) Specifies the version of SSH to be run on your router.
Configuring a Router for SSH Version 2 Using RSA Key Pairs
Perform this task to enable SSH Version 2 without configuring a hostname or a domain name. SSH Version 2 will be enabled if the key pair that you configure already exists or if it is generated later. You may also configure SSH Version 2 by using the hostname and domain name configuration (see the Configuring a Router for SSH Version 2 Using a Hostname and Domain Name).
SUMMARY STEPS
2. configure terminal
3. ip ssh rsa keypair-name keypair-name
4. crypto key generate rsa usage-keys label key-label modulus modulus-size
5. ip ssh [ time-out seconds | authentication-retries integer ]
6. ip ssh version 2
Enables privileged EXEC mode.
- Enter your password if prompted.
Router# configure terminal
Enters global configuration mode.
Router(config)# ip ssh rsa keypair-name sshkeys
Specifies which RSA key pair to use for SSH usage.
Router(config)# crypto key generate rsa usage-keys label sshkeys modulus 768
Enables the SSH server for local and remote authentication on the router.
- For SSH Version 2, the modulus size must be at least 768 bits.
Router(config)# ip ssh time-out 12
Configures SSH control variables on your router.
Router(config)# ip ssh version 2
Specifies the version of SSH to be run on a router.
Configuring the Cisco IOS SSH Server to Perform RSA-Based User Authentication
Perform this task to configure the Cisco IOS SSH server to perform RSA-based user authentication. The user authentication is successful if the RSA public key stored on the server is verified with the public or the private key pair stored on the client.
SUMMARY STEPS
2. configure terminal
3. hostname name
4. ip domain-name name
5. crypto key generate rsa
6. ip ssh pubkey-chain
7. username username
8. key-string
10. key-hash key-type key-name
Enables privileged EXEC mode.
- Enter your password if prompted.
Router# configure terminal
Enters global configuration mode.
Router(config)# hostname host1
Specifies the hostname.
Router(config)# ip domain-name name1
Defines a default domain name that the Cisco IOS software uses to complete unqualified hostnames.
Router(config)# crypto key generate rsa
Generates RSA key pairs.
Router(config)# ip ssh pubkey-chain
Configures SSH-RSA keys for user and server authentication on the SSH server and enters public-key configuration mode.
Router(conf-ssh-pubkey)# username user1
Configures the SSH username and enters public-key user configuration mode.
Specifies the RSA public key of the remote peer and enters public-key data configuration mode.
Exits public-key user configuration mode.
Router(conf-ssh-pubkey-data)# key-hash ssh-rsa key1
(Optional) Specifies the SSH key type and version.
- The key type must be ssh-rsa for configuration of private public key pairs.
- This step is optional only if the key-string command is configured.
- You must configure either the key-string command or the key-hash command.
Exits the current mode and returns to privileged EXEC mode.
Configuring the Cisco IOS SSH Client to Perform RSA-Based Server Authentication
Perform this task to configure the Cisco IOS SSH client to perform RSA-based server authentication.
SUMMARY STEPS
2. configure terminal
3. hostname name
4. ip domain-name name
5. crypto key generate rsa
6. ip ssh pubkey-chain
7. server server-name
8. key-string
10. key-hash key-type key-name
12. configure terminal
13. ip ssh stricthostkeycheck
Enables privileged EXEC mode.
- Enter your password if prompted.
Router# configure terminal
Enters global configuration mode.
Router(config)# hostname host1
Specifies the hostname.
Router(config)# ip domain-name name1
Defines a default domain name that the Cisco IOS software uses to complete unqualified hostnames.
Router(config)# crypto key generate rsa
Generates RSA key pairs.
Router(config)# ip ssh pubkey-chain
Configures SSH-RSA keys for user and server authentication on the SSH server and enters public-key configuration mode.
Router(conf-ssh-pubkey)# server server1
Enables the SSH server for public-key authentication on the router and enters public-key server configuration mode.
Specifies the RSA public-key of the remote peer and enters public key data configuration mode.
Exits public-key data configuration mode and enters public-key server configuration mode.
Router(conf-ssh-pubkey-server)# key-hash ssh-rsa key1
(Optional) Specifies the SSH key type and version.
- The key type must be ssh-rsa for configuration of private/public key pairs.
- This step is optional only if the key-string command is configured.
- You must configure either the key-string command or the key-hash command.
Exits public-key server mode and returns to privileged EXEC mode.
Router# configure terminal
Enters global configuration mode.
Router(config)# ip ssh stricthostkeycheck
Ensures that the server authentication takes place.
- The connection is terminated on a failure.
Starting an Encrypted Session with a Remote Device
Perform this task to start an encrypted session with a remote networking device, (You need not enable your router. SSH can be run in disabled mode.)
Note The device you want to connect with must support an SSH server that has an encryption algorithm that is supported in Cisco IOS software. SUMMARY STEPS
Router# ssh -v 2 -c aes256-cbc -m hmac-sha1-96 -l user2 10.76.82.24
Starts an encrypted session with a remote networking device.
- Troubleshooting Tips
Troubleshooting Tips
The ip ssh version command can be used for troubleshooting your SSH configuration. By changing versions, you can determine which SSH version has a problem.
Enabling Secure Copy Protocol on the SSH Server
Perform this task to enable secure copy protocol on the SSH server. This task configures server-side functionality for SCP. This example shows a typical configuration that allows the router to securely copy files from a remote workstation.
Before You Begin
SCP relies on AAA authentication and authorization to function correctly. Therefore AAA must be configured on the router.
SUMMARY STEPS
2. configure terminal
3. aaa new-model
4. aaa authentication login default local
5. aaa authorization exec default local
6. username name privilege privilege-level password password
7. ip ssh time-out seconds
8. ip ssh authentication-retries integer
9. ip scp server enable
Enables privileged EXEC mode.
- Enter your password if prompted.
Router# configure terminal
Enters global configuration mode.
Router(config)# aaa new-model
Enables the AAA access control model.
Router(config)# aaa authentication login default local
Sets AAA authentication at login to use the local username database for authentication.
Router(config)# aaa authorization exec default local
Sets the parameters that restrict user access to a network; runs the authorization to determine if the user ID is allowed to run an EXEC shell, and specifies that the system uses the local database for authorization.
Router(config)# username samplename privilege 15 password password1
Establishes a username-based authentication system, and specifies the username, privilege level, and an unencrypted password.
Router(config)# ip ssh time-out 120
Sets the time interval (in seconds) that the router waits for the SSH client to respond.
Router(config)# ip ssh authentication-retries 3
Sets the number of authentication attempts after which the interface is reset.
Router(config)# ip scp server enable
Enables the router to securely copy files from a remote workstation.
- Troubleshooting Tips
Troubleshooting Tips
To troubleshoot SCP authentication problems, use the debug ip scp command.
Verifying the Status of the Secure Shell Connection Using the show ssh Command
To display the status of the SSH connection on your router, use the show ssh command.
SUMMARY STEPS
2. show ssh
Enables privileged EXEC mode.
- Enter your password if prompted.
Router# show ssh
Displays the status of SSH server connections.
Examples
The following output examples from the show ssh command display status about various SSH Version 1 and Version 2 connections.
Verifying the Secure Shell Status
Perform this task to verify your SSH configuration.
SUMMARY STEPS
2. show ip ssh
Enables privileged EXEC mode.
- Enter your password if prompted.
Router# show ip ssh
Displays the version and configuration data for SSH.
Examples
The following sample output from the show ip ssh command displays the version of SSH that is enabled, the authentication timeout values, and the number of authentication retries:
Monitoring and Maintaining Secure Shell Version 2
To display debug messages about the SSH connections, use the debug ip ssh command and the debug snmp packet command.
SUMMARY STEPS
2. debug ip ssh
3. debug snmp packet
Enables privileged EXEC mode.
- Enter your password if prompted.
Router# debug ip ssh
Displays debugging messages for SSH.
Router# debug snmp packet
Displays information about every SNMP packet sent or received by the router.
Example
The following sample output from the debug ip ssh command shows that the digit 2 keyword has been assigned, signifying that it is an SSH Version 2 connection:
Configuration Examples for Secure Shell Version 2 Support
- Example Configuring Secure Shell Version 1
- Example ConfiguringSecureShellVersion2
- Example Configuring Secure Shell Versions 1 and 2
- Example Starting an Encrypted Session with a Remote Device
- Example Configuring Server-Side SCP
- Example Setting an SNMP Trap
- Examples SSH Keyboard Interactive Authentication
- Example SNMP Debugging
- Examples SSH Debugging Enhancements
Example Configuring Secure Shell Version 1
The following example shows how to configure SSH Version 1:
Example ConfiguringSecureShellVersion2
The following example shows how to configure SSH Version 2:
Example Configuring Secure Shell Versions 1 and 2
The following example shows how to configure both SSH Version 1 and SSH Version 2:
Example Starting an Encrypted Session with a Remote Device
The following example shows how to start an encrypted session with a remote device:
Example Configuring Server-Side SCP
Example Setting an SNMP Trap
The following example shows that an SNMP trap has been set. The trap notification is generated automatically when the SSH session terminates. In the example, a.b.c.d is the IP address of the SSH client. For an example of SNMP trap debug output, see the section Example SNMP Debugging.”
Examples SSH Keyboard Interactive Authentication
- Client-Side Debugs
- TACACS ACS Is the Back-end AAA Server ChPass Is Enabled and a Blank Password Change Is Made
- TACACS ACS Is the Back-end AAA Server ChPass Is Enabled and the Password Is Changed on First Login
- TACACS ACS Is the Back-end AAA Server ChPass Is Enabled and the Password Expires After Three Logins
Client-Side Debugs
In the following example, client-side debugs are turned on and the maximum number of prompts = six, (three for the SSH Keyboard Interactive Authentication method and for the password method of authentication).
TACACS ACS Is the Back-end AAA Server ChPass Is Enabled and a Blank Password Change Is Made
In the following example, a TACACS+ access control server (ACS) is the back-end AAA server; the ChPass feature is enabled, and a blank password change is accomplished using the SSH Keyboard Interactive Authentication method:
TACACS ACS Is the Back-end AAA Server ChPass Is Enabled and the Password Is Changed on First Login
In the following example, a TACACS+ ACS is the back-end server, and the ChPass feature is enabled. The password is changed on the first login using the SSH Keyboard Interactive Authentication method.
TACACS ACS Is the Back-end AAA Server ChPass Is Enabled and the Password Expires After Three Logins
In the following example, a TACACS+ ACS is the back-end AAA server, and the ChPass feature is enabled. The password expires after three logins using the SSH Keyboard Interactive Authentication method.
Example SNMP Debugging
The following is sample output from the debug snmp packet command. The output provides SNMP trap information for an SSH session.
Examples SSH Debugging Enhancements
The following is sample output from the debug ip ssh detail command. The output provides debugging information about the SSH protocol and channel requests.
The following is sample output from the debug ip ssh packet command. The output provides debugging information about the SSH packet.
00:05:43: SSH2 0: MAC compared for #3 :ok
Where to Go Next
You have to use a SSH remote device that supports SSH Version 2, and you have to connect to a Cisco IOS router.
Additional References
Related Documents
Cisco IOS commands
Cisco IOS Security Configuration Guide: Securing User Services
- Configuring a hostname and host domain
- Configuring Secure Shell
“Configuring Secure Shell” module in the Cisco IOS Security Configuration Guide: Securing User Services .
Cisco IOS Debug Command Reference
Downloading a Cisco software image
Cisco IOS Configuration Fundamentals Configuration Guide Cisco IOS Network Management Configuration Guide
Cisco IOS configuration fundamentals
Cisco IOS Security Configuration Guide: Secure Connectivity
Cisco IOS Security Command Reference
SNMP, configuring traps
Configuring SNMP Support module in the Cisco IOS Network Management Configuration Guide
Standards
IETF Secure Shell Version 2 Draft Standards
No new or modified MIBs are supported and support for existing MIBs has not been modified.
To locate and download MIBs for selected platforms, Cisco software releases, and feature sets, use Cisco MIB Locator found at the following URL:
No new or modified RFCs are supported and support for existing RFCs has not been modified.
Technical Assistance
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.
Feature Information for Secure Shell Version 2 Support
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 1 Feature Information for Secure Shell Version 2 Support Secure Shell Version 2 Support
12.2(25)S 12.3(4)T 12.2(11)T
The Secure Shell Version 2 Support feature allows you to configure Secure Shell (SSH) Version 2 (SSH Version 1 support was implemented in an earlier Cisco IOS software release). SSH runs on top of a reliable transport layer and provides strong authentication and encryption capabilities.
In 12.3(11)T, support was added for the Cisco 10000 series router.
The following commands were introduced or modified: debug ip ssh , ip ssh min dh size , ip ssh rsa keypair-name , ip ssh version , ssh .
Secure Shell Version 2 Client and Server Support
12.0(32)SY 12.3(7)JA 12.4(17)
The Cisco IOS image was updated to provide for the automatic generation of SNMP traps when an SSH session terminates.
SSH Keyboard Interactive Authentication
This feature, also known as Generic Message Authentication for SSH, is a method that can be used to implement different types of authentication mechanisms. Basically, any currently supported authentication method that requires only user input can be performed with this feature.
Secure Shell Version 2 Enhancements
The Secure Shell Version 2 Enhancements feature includes a number of additional capabilities such as support for VRF aware SSH, SSH debug enhancements, and DH Group 14 and Group 16 exchange support.
In Cisco IOS 15.1(2)S, support was added for the Cisco 7600 series router.
The following commands were introduced or modified: debug ip ssh , ip ssh dh min size .
Secure Shell Version 2 Enhancements for RSA Keys.
The Secure Shell Version 2 Enhancements for RSA Keys feature includes a number of additional capabilities to support RSA key-based user authentication for SSH and SSH server host key storage and verification.
The following commands were introduced or modified: ip ssh pubkey-chain , ip ssh stricthostkeycheck .
Cisco and the Cisco Logo are trademarks of Cisco Systems, Inc. and/or its affiliates in the U.S. and other countries. A listing of Cisco’s trademarks can be found at www.cisco.com/go/trademarks. Third party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1005R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.
Was this Document Helpful?