*Jan 23 00:37:52.419: %LINK-5-CHANGED: Interface Serial0/0/0, changed state to administratively down *Jan 23 00:37:54.539: %SYS-5-RESTART: System restarted -- Cisco IOS Software, 1841 Software (C1841-ADVENTERPRISEK9-M), Version 15.1(4)M10, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2015 by Cisco Systems, Inc. Compiled Tue 24-Mar-15 08:30 by prod_rel_team *Jan 23 00:37:54.543: %SNMP-5-COLDSTART: SNMP agent on host R2 is undergoing a cold start *Jan 23 00:37:54.915: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF *Jan 23 00:37:54.915: %CRYPTO-6-GDOI_ON_OFF: GDOI is OFF *Jan 23 00:37:54.915: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF *Jan 23 00:37:54.915: %CRYPTO-6-GDOI_ON_OFF: GDOI is OFF R2>en R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#lin R2(config)#line co R2(config)#line console 0 R2(config-line)#pass R2(config-line)#password ciscotest R2(config-line)#login R2(config-line)#^Z R2# *Jan 23 00:38:59.447: %SYS-5-CONFIG_I: Configured from console by console R2#disabl R2#disable R2>exit R2 con0 is now available Press RETURN to get started. User Access Verification Password: ← キーイン R2>en
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#line au R2(config)#line aux 0 R2(config-line)#pass R2(config-line)#password ciscotest R2(config-line)#login R2(config-line)#^Z R2# *Jan 23 00:41:33.483: %SYS-5-CONFIG_I: Configured from console by console R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#lin R2(config)#line vt R2(config)#line vty 0 4 R2(config-line)#pass R2(config-line)#password ciscotest R2(config-line)#login R2(config-line)#^Z R2# *Jan 23 00:42:02.035: %SYS-5-CONFIG_I: Configured from console by console
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#int f0/0 R2(config-if)#ip addr 172.16.128.254 255.255.255.0 R2(config-if)#no shut R2(config-if)#^Z R2# *Jan 23 00:45:53.383: %SYS-5-CONFIG_I: Configured from console by console R2# *Jan 23 00:45:53.755: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up *Jan 23 00:45:54.755: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
C:\Users\wnogu>ping 172.16.128.254 172.16.128.254 に ping を送信しています 32 バイトのデータ: 172.16.128.254 からの応答: バイト数 =32 時間 =7ms TTL=255 172.16.128.254 からの応答: バイト数 =32 時間 =1ms TTL=255 172.16.128.254 からの応答: バイト数 =32 時間 =1ms TTL=255 172.16.128.254 からの応答: バイト数 =32 時間 =1ms TTL=255 172.16.128.254 の ping 統計: パケット数: 送信 = 4、受信 = 4、損失 = 0 (0% の損失)、 ラウンド トリップの概算時間 (ミリ秒): 最小 = 1ms、最大 = 7ms、平均 = 2ms
User Access Verification Password: R2>en Password: R2#
line con 0 exec-timeout 0 0 password ciscotest logging synchronous login line aux 0 password ciscotest login line vty 0 4 exec-timeout 0 0 password ciscotest login transport input all
R2#show users Line User Host(s) Idle Location 0 con 0 idle 00:03:41 194 vty 0 idle 00:02:18 172.16.128.4 *195 vty 1 idle 00:00:09 172.16.128.4 Interface User Mode Idle Peer Address R2#
なんぞこれー vty のセクションが分かれとる。。。
line vty 0 4 exec-timeout 0 0 password ciscotest login transport input all line vty 5 15 exec-timeout 0 0 login transport input all
telnet/ssh での VTY アクセスはノーガードでログインはできない。
AAA を実装していればそちらで対応できるようです。
特権 EXEC モードへ移行するにはパスワードを要求される。
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#lin R2(config)#line vty 0 15 R2(config-line)#pass R2(config-line)#password ciscotest R2(config-line)#login R2(config-line)#end R2# *Jan 25 00:25:28.344: %SYS-5-CONFIG_I: Configured from console by console R2#sh run | sec line vty 0 15 R2#sh run | begin line vty line vty 0 4 exec-timeout 0 0 password ciscotest login transport input all line vty 5 15 exec-timeout 0 0 password ciscotest login transport input all ! scheduler allocate 20000 1000 end
R2#sh run | inc password no service password-encryption password ciscotest password ciscotest password ciscotest password ciscotest R2#sh run | inc enable
`sh users` で固まるのは逆引きのせい?
R2(config)#no ip domain-lookup R2(config)#^Z R2# *Jan 25 00:31:56.620: %SYS-5-CONFIG_I: Configured from console by console R2#sh users Line User Host(s) Idle Location * 0 con 0 idle 00:00:00 194 vty 0 idle 00:04:11 172.16.128.4 Interface User Mode Idle Peer Address
↑爆速
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#ip domain-lookup R2(config)#^Z R2#sh users *Jan 25 00:32:57.780: %SYS-5-CONFIG_I: Configured from console by console R2#sh users Line User Host(s) Idle Location * 0 con 0 idle 00:00:00 194 vty 0 idle 00:05:09 ←ここで固まる。Location が表示されない。
特権 EXEC モードへ移行するにはパスワードを要求される。 ようなんだけど、今のコンフィグだと昇格できてしまう。
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#line conso R2(config)#line console 0 R2(config-line)#no pa R2(config-line)#no pass R2(config-line)#no password R2(config-line)#^Z R2# *Jan 25 00:35:55.984: %SYS-5-CONFIG_I: Configured from console by console R2#disable R2>exit R2 con0 is now available Press RETURN to get started. R2>en R2#
コンソールのパスワード消したら蹴られるようになった。
User Access Verification Password: R2>en % No password set R2>
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#line con 0 R2(config-line)#password ciscopower R2(config-line)#^Z R2# *Jan 25 00:38:50.948: %SYS-5-CONFIG_I: Configured from console by console
ラインコンフィグレーションモードで設定したパスワードをキーインして特権 EXEC モードに移行できた。 VTY のパスワードで認証しているわけではないんだな。
定石の enable password
/ enable secret
の設定をする。
enable password
の設定
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#enab R2(config)#enable sec R2(config)#ena R2(config)#enable pass R2(config)#enable password ciscoadm R2(config)#^Z R2#sh *Jan 25 00:59:54.819: %SYS-5-CONFIG_I: Configured from console by console R2#sh run | inc enable pass enable password ciscoadm
R2>en Password: Password: R2#disab R2>en Password: ← line con 0 のパスワードは蹴られる Password: ← enable password だと通る R2#disable
今度は enable secret
の設定
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#enable secret ciscohighadm R2(config)#^Z R2# *Jan 25 01:02:40.551: %SYS-5-CONFIG_I: Configured from console by console R2#sh run | inc enable enable secret 5 $1$cZtx$Z5Jhba7QXU/olmSSl37Ba0 enable password ciscoadm
↑暗号化されている enable secret
R2>en Password: ← line con 0 のパスワードは蹴られる Password: ← enable password も蹴られる Password: ← enable secret だと通る
service password-encryption
service password-encryption
コマンドを使えば enable secret
を除いたパスワードが暗号化される。
ただし暗号強度が低いので特権EXECモードに移行するパスワードについては enable password
よりも enable secret
を使用すべきである。
R2#sh run | inc (pass|enab) no service password-encryption enable secret 5 $1$cZtx$Z5Jhba7QXU/olmSSl37Ba0 enable password ciscoadm password ciscopower password ciscotest password ciscotest password ciscotest
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#service password-encryption R2(config)#^Z R2# *Jan 26 00:51:51.370: %SYS-5-CONFIG_I: Configured from console by console
R2#sh run | inc (pass|enab) service password-encryption enable secret 5 $1$cZtx$Z5Jhba7QXU/olmSSl37Ba0 enable password 7 030752180500204843 password 7 121A0C0411041C0B3D2E36 password 7 03075218050035495D1D password 7 13061E010803102F3830 password 7 060506324F411D1C1603